Vous êtes sur la page 1sur 3

Introductioni protocols. Link layer Data transfer between directly-linked nodes.

WiFi, Ethernet, DSL, PPP, FDDI, server Message format - MIME-like format: consists of some number of header lines, followed by a 7Local server obtains the answer 8.Local server returns the answer to requesting application DNS Communication Services and Application A communication service enables the exchange of Bluetooth. Physical layer Bits on the wire/physical media. Performance Model Factors Link blank line, then a body portion of text. TCP connection closed. HTTP is stateless: Server maintains Queries Recursive query Puts burden of resolving the name query on contacted name server. The information between users at different locations. Communication services & applications are transmission rate (throughput/bandwidth) Distance between two hosts. Protocols used. Transmission no information about the clients (server will not remember client) In the past, all web pages were queried name server is obliged to give back answers & report errors. Iterative query Contacted server everywhere. e.g. Email, web browsing, file transfer, information feed, instant messaging, internet rate(Throughput) = no. of bits transmitted per time unit. 1/T = time taken to transmit each bit of data static pages; makes error recovery really simple Web Request A client must give an address to replies with name of server for further contact to lookup the answer I dont know this name, please phone, P2P, network games etc. Basic Building Blocks End-systems / hosts Millions of connected Latency(delay) time taken for a message to travel from host A to host B. Depends on Transmission access a Web object. URL Uniform Resource Locators. Serve as the page's worldwide address. ask this server Caching in DNS To reduce DNS traffic, caching is employed. Reasons: Local computing devices. Running network applications Communication Links Point-to-point guided media - delay dtx = message size/throughput . How fast we can push the X bits into the link. Time for URL consists of three parts: http:// - protocol i.cs.hku.hk/ - domain name of remote host authoritative name servers only have authority on their unit; Root servers become the critical Wire (copper, optic fiber) unguided media - Wireless (Satellite) Multiple access Ethernet, Token transmitting all bits into the network Propagation delay dpg = distance/signal speed Time and ~c0234a/view/SimpleWebpage.html - file name relative to default web directory. A web page bottleneck if every search goes through them every time. Caching improves efficiency: Eliminates ring, FDDI, WiFi, Bluetooth Switched network (Cloud) A set of connecting devices Internetwork A set propagation speed of signal in the link. Time for a bit to propagate from one end to the other. Latency consists: A base html file and associated objects - Graphics, images, video, audio Request Type unnecessary search - Get answers back from authoritative servers, reuse info in the future. Learn of independent networks are interconnected to form an internetwork. A network can be defined = transmission delay + propagation delay. Bandwidth vs. Latency For small message: propagation GET Request to read a Web page HEAD Request to read a Web page's header PUT Request to name servers (addresses) that are authoritative for some domains. Time to Live (TTL) Trade-off recursively as two or more networks connected by a connecting device Switches and Routers delay >> latency. For large message: transmission time >> latency. Processing delay dpr Check bit store a Web page POST Append to a name resource (e.g., a Web page) DELETE Remove the Web between performance and consistency: The duration that any name server is allowed to cache the Forward the messages toward the ultimate destination. Router connects multiple networks network: errors. Examine packets header to determine output link. Queuing delay dqu Time waiting at output page TRACE Echo the incoming request CONNECT Reserved for future use OPTIONS Query data DNS Resource Records Each name server maintains a collection of resource records. Network layer information Protocol is a set of rules that defines i) format of message ii) order of link for transmission. Depends on router/switch congestion level End-to-end delay Assume N-1 certain options Behaviour of HTTP Connection Non-persistent Connection http/1.0 After TCP RR format: (name, value, type, class, ttl) We only have interest in one class: IN. Name/Value: not messages sent and received among network entities iii) actions taken on messages transmission network devices between A & B, N links have same transmission rate, each link has same length, connection established, at most one object is sent in this TCP connection, then close the connection. necessarily host names to IP addresses. Type=A name:hostname value:IP address Type=NS name: and/or receipt of messages. The Internet and computer networks make extensive use of protocols. network is uncongested (minimal queuing delay), s N pr tx pg (end-to- Time for fetching each object: 1 RTT to initiate TCP connection, 1 RTT for HTTP request and first few domain (e.g. foo.com) value:IP address of auth. name server Type=PTR name: arpa address Different protocols are used to accomplish different communication tasks. Network Edge End- end) Throughput Rate (bits/time unit) at which bits transferred between sender/receiver. bytes of HTTP response to return, File transmission time Total = 2RTT+transmit time To improve value: hostname Type=CNAME name: alias name value: canonical (real) name Type=MX value: systems / Hosts At edge of network. Have more intelligence. Run network applications e.g. firefox. Instantaneous throughput Average performance, many browsers open multiple parallel connections to simultaneously fetch multiple name of mailserver associated with name Summary SMTP Push protocol. Email communication Source and/or sink of data Client/Server model client host requests, receives service from always-on throughput rate over long(er) period of time Bottleneck link link on end-to-end path that constrains referenced objects. RTT: time to send a small packet to travel from client to server and back, involves at least four hosts in the message transfer: User agentMTAMTAUser agent. Email server e.g. Web browser/server; email client/server Peer-to-peer model minimal/no use of dedicated end-to-end throughput Summary Multiplexing To make efficient use of high-speed including dpg, dqu & dpr between sender and receiver Persistent connection Server leaves connection message is structured into 3 parts: envelope, headers & body. Message transfer between two agents servers e.g. Skype, BitTorrent Addressing and Routing Address byte-string that identifies a node. telecommunication lines. Multiplexing allows several transmission sources to share a larger open after responds to the first request. Multiple objects can be sent over the same TCP connection involves multiple RTTs. MIME allows arbitrary binary data to be exchanged Summary HTTP Pull Unique address for each node (host, switch, router) Types of addresses Unicast address refers to transmission capacity. FDM a number of signals are carried simultaneously on the same medium between client and server Persistent without pipelining Client issues new request only when previous protocol. Message is formatted to three sections status line, header lines, entity body. Open a Web a single system Broadcast may address all entities within a domain Multicast May address a subset by allocating to each signal a different frequency band. TDM data from various sources are response has been received. 1 RTT for each referenced object Persistent with pipelining (default) page involves more than one Web object. Non-persistent connection requires establishing one TCP of the entities in a domain Routing is the process of finding the route to forward messages to the interleaved with one another; each source occupies a portion of time in the link. Statistical Default in HTTP/1.1 Client sends multiple HTTP requests as soon as the client knows the need to connection for each object. Persistent connection uses one TCP connection to download all Web destination based on destination address Typical Home network Connect via DSL or cable multiplexing time slots are not pre-assigned to particular data sources; link transmission capacity download the referenced objects. As little as one RTT for all the referenced objects Advantages objects from the same server. Caching is often used in network applications to reduce network traffic modemNAT router (with wireless)Ethernet Notation B = byte, b = bit Transmission rate Kbit/s = will be shared on a packet-by-packet basis only among those users who have packets that need to Eliminate the overhead of multiple TCP connection setups: relieve the server load, reduce the delay and improve response time. Mechanisms must be provided to validate whether those cached objects Kb/s = Kbps = kbps = 1000 bits per second Mbit/s = 106 bits per second Mbyte/s = MB/s = 106 bytes be transmitted. Summary Network architecture A network architecture is the layered structure of perceived by the user less RTTs. Better utilizing the TCP Technical issues How long should the are up-to- date or already turned stale Summary SMTP Provides a mapping service: maps per second Memory size KiBytes = KiB = 210 bytes = 1024 bytes MiBytes = MiB = 220 bytes = hardware and software that supports the exchange of data between end systems. At each layer of server keep the TCP connection? With many client connections, this creates significant resource hostname to IP address and vice versa. For resolving a name query, it involves one or more name 1048576 bytes Network Core Mesh of connecting devices and links. Forwarding data to destination the network architecture, one or more common protocols are implemented. Each protocol provides a demand. Servers using time-out and close a connection if no requests for a period of time. Both client servers, and the local name server is the first server to start with. Because of the arbitrarily large set communication is typically achieved by transmitting data from source to destination through a network set of rules for the exchange of data between systems. Summary Performance Packet travels from and server can elect to close the connection. Web Caches (Proxy Server) Browser (user) accesses of mapping information, naming system is structured in a form of distributed, hierarchical database. of intermediate switching nodes. Data are routed by being switched from node to node. Forwarding source host to destination host may pass through a series of network nodes. Src X X Web via cache. Client sends all http requests to cache: if object is in web cache, cache then returns (& routing) is related to the transfer of data messages from an incoming link to an outgoing link within X Dest Packet suffers from several types of delays at each node along the path. Transmission object; else cache requests object from origin server, then returns object to client; Cache (proxy) acts a switch or router. Switching schemes Circuit switching Designed for voice, e.g. telephone networks. delay is the amount of time required to push all the packets bits into the link, which is directly as both client and server. Typically cache is installed by university, company and ISP. Primary Before communication, the network must establish a connection between the sender and the proportional to the size of the packet and link bandwidth. Propagation delay is the time needed for a objective is to improve performance: try to satisfy clients requests without involving origin server receiver. Dedicated communication path The resources needed along the path are reserved for the bit to propagate to the next node, which is depended on the distance between the nodes and the Advantages Smaller response time cache is closer to client as they are usually in same network. duration of the communication session. Dedicated resources: no sharing. Reserve link bandwidth, speed of the signal in the medium. Decrease traffic to distant servers: link out of institutional/local ISP network often is the bottleneck switch capacity. Circuit-like (guaranteed) performance Call setup required: find the path, determine if Network Applications Email (SMTP) Characteristics Client-Server Architecture: client host requests Conditional GET Cached contents may become stale. Resolution Before caching - download the next hop is free, reserve the link/channel. Carry data streams. Teardown the circuit. Switches on the and receives service from an always-on server. TCP as the carrier. Request-Response interaction object by the cache from origin server. Origin server includes the header: Last-Modified header Lastpath between sender and receiver maintain connection state for that connection. Pros&Cons Good mode: Typically client sends the request and server replies with the requested information or service. Modified: Fri, 20 Jan 2006 04:25:16 GMT When proxy needs to server later requests, it sends a for bursty data traffic. Simpler, no call setup. (typical behavior only) Allow different data rates between Text-based communication. Major components User agents Mail servers Transfer protocols: Simple condition GET request to origin server: Normal GET with the IF-Modified-Since header If-Modifiedtwo stations. Link utilization Allows more users to use network. Packets queued and transmitted as Mail Transfer Protocol - (RFC 821) (RFC 2821) (RFC 5321) Post Office Protocol - (RFC 1939) (RFC Since: Fri, 20 Jan 2006 04:25:16 GMT Suppose object not modified. Origin server responses: fast as possible. Service guarantee Packets may experience random delays & possible loss. May 2449) Internet Message Access Protocol - (RFC 1733) (RFC 3501) Message Format: (RFC 822) HTTP/1.1 304 Not Modified, Not including the object in the response Cookies can bring: have out-of-order delivery. Packet-switching Designed for data communication. Connectionless (RFC 2822) MIME RFC 2045-2049 User Agent mail reader or email client: For composing, editing, authorization, shopping carts, recommendations, user session state (Web e-mail) Domain Name network: resources are not reserved and are used as needed, different flows share network reading mail messages Use SMTP to transmit outgoing messages to server Use IMAP or POP to System (DNS) Naming Internet communication requires IP addresses. This is the only way we can resources. Message is broken into small chunks of data known as packets: usually of variable lengths retrieve incoming messages stored on server Mail Servers MTA mail transfer agent (mail daemon) locate a host in the Internet. Humans prefer to use computer names e.g., mail.yahoo.com, up to the hardware limit. Packets passed from node to node between source and destination. Store- SMTP protocol between mail servers (MTAs) to transfer email messages: client/server Consists of: mail.google.com. System automatically translates names to addresses (values) for us. Given name of and-forward transmission: packets move one hop at a time, node receives complete packet before mailboxes contain incoming messages (yet to be read) for users, message queue for outgoing (to be a computer (or Internet address): returns computer's Internet address (or computer name) forwarding - buffered briefly, packets may experience random delays & possible loss. Pros&Cons sent) mail messages SMTP [RFC 821&2821] uses TCP to reliably transfer email messages from Characteristics Client-server interaction. Uses UDP as the carrier. No single server; store all Good for constant data streams. Set up takes time. Both ends must operate at the same data rate. MTA client (or user agent) to MTA server using port # 25 Mostly direct transfer from sending mail information in a distributed database: implemented by hierarchy of name servers. Client contacts one Link utilization Fixed allocation, fixed number of users. If no data, capacity is wasted. Service server to receiving mail server After established TCP connection, there are three phases of transfer: or more name server to request for service as necessary. A name server can become the client of guarantee Once connection, no danger of congestion. Guarantee in-order delivery. Sharing of handshaking (greeting), transfer of one or more email messages, closure Command/response another name server. Services Hostname to IP address translation. IP address to hostname Communication Link Multiplexing involves the sharing of network resources by several information interaction: Commands (ASCII text) Response: status code and phrase All messages must be in 7-bit translation. Host aliasing: given alias names, translate to canonical (real) hostname. Mail server flows. Circuit switching (Synchronous) Time-Division Multiplexing (TDM) & Frequency-Division ASCII Send Email 1.Compose message using Thunderbird and set to c0234a@gmail.com aliasing: returns the canonical names of the domain mail servers. Load distribution e.g., replicated Multiplexing (FDM) Packet switching Statistical Multiplexing TDM time on the circuit is divided into 2.Thunderbird sends message to CS local mail server testmail.cs.hku.hk; message placed in Web servers: set of IP addresses for one canonical name, Different users may select different equal-sized quanta: time sharing. Each flow gets a specific time slot: time slots pre-assigned to message queue 3.Client side of SMTP at testmail.cs.hku.hk opens TCP connection with Googles machine of IP address for requesting services Domain Name Structure Domain name is a sequence sources and are fixed; allocated even if not carrying any data. FDM works by dividing the frequency mail server mx.google.com 4.SMTP client sends my message over the TCP connection message of labels from the leaf node to the root of the whole tree with dots between labels. A label is limited to range of a physical link into smaller frequency channels: transmit each flow over the medium at 5. Googles mail server places the message in mailbox 6.Use Gmail to read the mail Handshaking 63 bytes. Distributed Hierarchical Database Distributed database No single entity manages every difference frequencies. Channel allocated even if no data. Commonly used to multiplex telephone connection setup 1.Thunderbird opens TCP connection with testmail 2.Once connected, server label in the tree. signals before digital transmission became common, e.g. broadcast radio, CATV Statistical identifies itself: 220 <domain> service ready 3.Client identifies itself: HELO (or EHLO) 4.Server Multiplexing On-demand time-division multiplexing: used as needed by different flows rather than accepts clients identification: 250 OK If mail service not available, step 2 becomes: 421 service not having a pre-allocated timeslot per flow. Packets from different sources may contend for the same available RFC2821 Extra info replies by the server to indicate what parameters this server supports: outgoing link: packets queue and wait for their turn, buffer (queue) overflow is called congestion. 250-Hello, pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-EXPN 250Transmission is scheduled on a per-packet basis: if only one flow has data, it gets to transmit VERB 250-8BITMIME 250-SIZE 250-DSN 250-DELIVERBY 250-HELP Mail Transfer Client may continuously without waiting for its slot to come around, each packet contains portion of user data + send one or more messages to server after the greeting. Each mail contains 1.MAIL FROM: control info (routing/addressing) to identify which data flow this packet belongs to. Network command identifies originator Gives reverse path to use for error reporting mail from: Architecture is the blueprint that specifies how the network is built and operated. Internet consists of <atctam@cs.hku.hk> \r\n Server returns 250 OK or appropriate fail/error message 2.One or more many pieces: End-systems (Computer, PDA, mobile, switch, router) Technologies (Ethernet, WiFi, RCPT TO: commands identifies recipients of the message rcpt to: <c0234a@gmail.com> \r\n DATA Bluetootth, WiMAX, GPRS) Applications (Email, BT, WWW, FTP, MSN, Youtube) Protocols (TCP, IP, command transfers message text. End of message indicated by line containing just period . \r\n Organization administering a domain can divide it into subdomains: Delegating these subdomains to STCP, RIP, SIP, RTP, OSPF) Layered architecture Partitions overall communication process into Closing Connection Two steps 1.Client sends QUIT and waits for reply: This initiates TCP close other organizations. These organizations can further subdivide those subdomains: hku.hk is a separate functional areas. Discuss a well-defined, specific part of a large and complex system and operation (on the client side) 2.Server initiates TCP close after sending reply to QUIT Mail message subdomain of hk. The domain hku.hk is delegated to CC at HKU for running the campus networks; use abstractions to hide complexity. Partition related communications functions into modules that are format Each mail is structured in a specific format defined in RFC 822 (2822) Header lines e.g. To: cs.hku.hk is a subdomain of hku.hk. The domain cs.hku.hk is delegated to CS at HKU manageable, easy to maintain or update or change of implementation: simplifies design, From: Subject: Keyword followed by colon followed by arguments Body message, ASCII characters Implementation All domain name servers are linked together to form a unified system. Each server implementation and testing as well as modifying and evolving; each layer provides services to the only Multipurpose Internet Mail Extension (MIME) Extension to RFC822 SMTP cannot transmit non- knows how to reach a root server and how to reach servers that are authorities for names further layer above via its own internal-layer actions and uses the services from the layer below. Can have ASCII data. Binary, audio, video, images, pdf Cannot transmit text including international down the hierarchy. Root Name Servers Known (publicly) by all local name servers. Will be contacted multiple abstractions at each layer. Protocols A set of rules. Realization of the abstraction. Abstract characters. Additional lines in message header declare MIME info Five new message header fields by local name server if it cannot resolve name. May not know authoritative name server of the objects that make up the network system layers: building blocks of a network architecture. Two 1.MIME version Identifies the MIME version 2.Content type Type and format of the content targeted subdomain. Have information on all Top level domain authoritative name servers: who the different interfaces: Service interface Operations or services that a layer offers to the layer above 3.Content transfer encoding How the data is encoded for transmission 4.Content Id Used to local name server to contact to find authoritative name server of that subdomain; returns IP address Peer-to-peer interface Specify the message format in message exchanged with peer of the same uniquely identify MIME entities in multiple contexts 5.Content Description Plaintext description of of suitable intermediate name server to local name server Top-level Domain servers Responsible for layer Encapsulation Each protocol uses a header (/trailer) that carries protocol specific information: the object Content Types Definitions for a set of content types. Content-Type: type/subtype; com, org, net, edu, etc, and all top-level country domains uk, fr, ca, hk. Authoritative DNS servers address, protocol number, length etc; used by receiver-side peer protocol object. Forms the Protocol parameters Text subtypes: plain, richtext, html. Image subtypes: jpeg, gif. Audio subtypes: basic (8- Organizations DNS servers, providing authoritative hostname to IP mappings for organizations Data Unit of this protocol layer rogether with the data passed from the layer above. Multiplexing & bit m-law encoded) Video subtype: mpeg. Application: other data that must be processed by reader servers (e.g., Web, mail); Can be maintained by organization itself or another service provider Local Demultiplexing Sharing of layer x service by multiple layer x+1 users. Demux key: identifier in the before viewable, subtypes: msword, octet-stream. Multipart subtypes: mixed, parallel, alternative name servers Does not strictly belong to hierarchy each ISP, company, university has one; Also header x to identify the receiving protocol object of level x+1 to which the message belongs. Mail Access Protocols SMTP: PUSH message to receivers server Mail access protocol: retrieval called or known as default name server; When a client host makes DNS query, query is sent to its Overhead n-layer protocol hierarchy, messages of length M bytes with h-byte header. Total number from server PULL Post Office Protocol POP(v3): authorization (agent <-->server) and download local DNS server, which acts as proxy, to answer the query or to forward query into hierarchy of header bytes per message = hn Total message size = M + nh Fraction of network bandwidth filled Internet Mail Access Protocol IMAP (v4): more features (more complex), manipulation of stored Servers/Authoritative DNS Servers/Local Name Servers Name Resolution DNS client-server with header = hn/(M+hn) If M >> hn, overhead is not too high; if M or header size or n , overhead messages on server. HTTP: Webmail, GMail, Y!Mail The Web (HTTP) Characteristics Client-Server interaction Multiple DNS servers may be involved. Application: Becomes DNS client; Sends request Internet Architecture Protocol Stack Protocols of various layers of the network make up the network Architecture. TCP as the carrier. Request-Response interaction mode, client: browser that requests, to local DNS server. Local DNS server: If answer known, returns response; If answer unknown, starts system. Internet Protocol Stack Defined by Internet Engineering Task Force (IETF). Hourglass design.receives, displays Web objects server: Web server sends objects in response to requests. Text- at root server Resolution Process 1.Local DNS server receives a recursive query from the application Application layer Network applications run on this layer. HTTP, SMTP, DNS, FTP, RTP, SNMP, based communication. http1.0: RFC 1945 http1.1: RFC 2616 Request/Response Client initiates TCP 2.Local server sends an iterative query to a Root server 3.Root refers local server to the TLD server Telnet, MSN Transport layer Support transferring of data between endpoints (processes). TCP, UDP connection (creates socket) to server using port # 80 Server accepts TCP connection from client. 4.Local server sends an iterative query to TLD server 5.TLD server refers local server to the SCTP, DCCP. Network layer Routing of datagrams from source to destination. IP and routing Exchanging HTTP messages (application-layer protocol messages) between browser and Web Authoritative server 6.Local server sends an iterative query to authoritative server

Transport Layer Provide logical communication between application processes running on different When timeout Retransmit oldest unACKED packet and all higher seq # packets, which has been sent Handshake: initialize TCP state info (variables): initial seq# (ISN) for connections in each direction, bandwidth: Transmitters dynamically adjust transmission rate according to network; congestion as hosts: Act as a logical channel that connects up the processes; Free from the details of physical but not yet ACKed Go-back-N Receiver will only accept a packet that is error-free and that has the buffers, flow control info (e.g. Receive Window), MSS Involve two remote processes: has no idea indicated by feedbacks from network Effects of congestion Longer delay as experiencing long queues networks. This abstraction is implemented by transport protocols. Transport protocols run in hosts - expecting sequence number: The receiver maintains a receive window of size 1; need only remember of what is happening to its partner. Connecting via an unreliable network: setup packet could be lost; in routers. Even if we assume a hypothetical scenario router with infinite buffer capacity: No packet Sender side: break app messages into segments, pass to network layer; Receiver side: reassemble expected seqnum. When such packet arrives, expectedseqnum is incremented by one, so the could arrive out-of-order. Could be delayed by congestion: induced retransmissionduplicated setup loss; If packet arrival rate (from all incoming flows) reaches the (outgoing) link capacity, the queue segments into messages, pass to app layer. More than one transport protocol available to receive window slides forward to the right by one: send ACK for the correctly-received in-order packets. Communication processes need to keep state info: problem with machine crash which loses becomes longer and longer, further increase network delay; adverse effect - too many unnecessary applications: Internet TCP and UDP Transport layer vs. Network layer Both layers provide logical packet. Out-of-sequence packets: discard (dont buffer)no receiver buffering! Re-ACK packet with all state info Three-way Handshake Client: active open; Server: passive open 1.Client sends a TCP retransmission; further increase congestion. Packet loss due to buffer overflow at routers: Rely on communication channels Network layer Logical communication between hosts Transport layer highest in-order seq # generates duplicate ACKs (no NAK is used) Selective Repeat Go-Back-N is SYN segment to server (CONNECT): specifies initial seq# (C_ISN#), which appears to be randomly retransmission to recover from the loss; however, performance suffers. Resources used by the lost Logical communication between processes: A host can have multiple processes concurrently using inefficient (if have errors) because multiple packets are resent when errors or losses occur. SRs generated; no data 2.Server recv SYN, sends a SYN+ACK segment (ACCEPT): Server specifies its packet before the loss become waste Congestion Behaviour Light traffic Packet arrival Rate << R the network layer services. Rely on as well as enhancing, network layer services: Services can be sender only resends packets for which ACK not received: sender timer for each unACKed packet. own initial seq# (S_ISN#); ack with ACK flag set and ACK# stored as C_ISN#+1; no data 3.Client (transmission capacity of the bottleneck link) Short queue; experience low delay. In principle, can offered by a transport protocol even missing in the underlying network layer User Datagram Protocol Sender window: N consecutive seq #s; again limits the number of outstanding unACKed packets. then replies with an ACK segment: may contain data; seq# carries C_ISN#+1, ack carries S_ISN#+1 accommodate more traffic. Network utilization increase as the offered load increases Knee (UDP) Just a minimal extension of the best-effort unreliable service of IP. No guarantee of data Receiver maintains a receive window of sequence numbers that can be accepted: Receiver If no server process listens to destination port, a reset segment (by setting the RST bit) is sent to (congestion onset) Arrival rate approaches R Delay increases rapidly as queue starts to build up. delivery and arrival order of segments. Just process-to-process data delivery and error checking. individually acknowledges all correctly received packets. Error-free but out-of-sequence packets with reject connection. Server and client have their own initial seq#. Each SYN segment consumes 1 unit Application throughput increase at a rate slower than the increase in offered load Congestion Services not available delay guarantees & bandwidth guarantees. "No frills" Internet transport sequence numbers within receive window are accepted & buffered. Arrival of expected packet (in of sequence space: SYN seg consumes 1 byte even it carries no data; Receiver of SYN segment collapse Arrival rate > R. Large delays because of long queue and starts to have packet loss. Useful protocol: Almost raw IP except support Multiplexing & demultiplexing and Error checking. UDP sequence) causes window to slide forward by one or more. Behaviour of Receiver Packet n in must send ACK - Retransmission of SYN Connection Termination A "four-way" handshake protocol: application throughput drops. Because of retransmission, further increase in offered loadfurther segments may be lost or delivered out of order. Connectionless: No handshaking between UDP [rcvbase, rcvbase+N-1]: send ACK(n) If out-of-order: buffer it; If in-order: deliver to upper layer (also Symmetric release, either end can terminate first; treat a bidirectional channel as two unidirectional drop in application throughput. Desired operating point: just before knee TCP Congestion Control sender & receiver - less delay in communication. No connection state at sender & receiver - less deliver buffered, in-order packets), advance window to next not-yet-received packet. Packet n in channels, each direction releases the connection independently; hang-up means stop sending, still TCP sender should transmit as fast as possible, but without congesting network Challenges How to overhead in managing this logical communication channel. Each UDP segment handled [rcvbase-N,rcvbase-1]: ACK(n) because those ACKs may have lost. Otherwise: ignore Behaviour of could receive data (half-close) 1.Client end system sends TCP FIN control segment to server find rate just below congestion level; How to perceive that there is congestion; How to adjust rate in independently. Smaller UDP header waste less bandwidth. No flow and congestion control: UDP can Sender rdt_send(): data from above If window not full, send packet Timeout(n): resend packet n, 2.Server receives FIN, replies with ACK. Closes connection, sends FIN 3.Client receives FIN, replies response to changes in the congestion condition Basic principle No explicit feedback from network. blast away as fast as desired; Finer application-level control. Good for some applications do not need restart timer. recv ACK(n) in [sendbase,nextseqnum-1]: mark packet n as received.If n == sendbase, with ACK. Enters timed wait state 4.Server receives ACK. Connection closed. The sources detect congestion from observed loss (& delay) Congestion Window Flow control a reliable transfer: real-time multimedia UDP Segment Header Source and destination port numbers. advance window forward to next unACKed seq # Window Size Given k bits for storing the seq. #, Timed wait state (30s/1min/2min) will respond only to retransmission FINs (from hostB); If such UDP length: Total number of bytes in segment (including header) 8 bytes length 2 16 UDP window size should be 2k-1 Summary Transport layer has the critical role of providing segment arrives, resend ACK & restart TIME_WAIT timer. If a response to FIN is lost, server will window Congestion Window reflects the estimated capacity of the network by the sender. Max Checksum base on Internet Checksum UDP multiplexing & demultiplexing Identify by 2-tuple: (dst communication services directly to the application processes on different hosts end-to-end. UDP release the connection after retransmits its FIN some number of times. Similarly, a FIN segment also number of bytes of unacknowledged data that may be sent at any time: MIN(RcvWin, CongWin): addr, dst port) When host receives UDP segment: Checks destination port number, Directs UDP only provides minimal transport layer services: Process-to-process communication multiplexing and consumes 1 Seq# 2nd ACK & 3rd FIN can be sent by one segment; this reduces to a "3-way" LastByteSent - LastByteAcked min{RcvWin, CongWin} TCP is allowed to send no faster than the segment to socket with that port number. Source port number is not used in demultiplexing: demultiplexing amongst processes in the same host; Errorchecking using Internet Checksum. UDP handshaking (this seldom happens) TCP Timeout Interval Retransmission timer is used: set a timeout slowest component: the network or destination host can accommodate Bandwidth Probing Each TCP Segments with different source IP addresses and/or source port numbers directed to same socket. has a small header; thus, relatively smaller header overhead. Checksum is an error-detecting timer when sends data; if no ACK receives when timer expires, retransmit the data. Need to be longer sender sets its own rate, based on implicit feedback: received ACK segment, network not congested, UDP Checksum Several Internet protocols (IP, TCP, UDP) include extra check bits to detect bit scheme that applicable to messages of any length: Split the message into piece of 16-bit, add the than RTT, but RTT varies. For Local Area Network (LAN), RTT delay is highly predictable; thus RTT so increase sending rate; detect segment loss: assume loss due to congested network, so decrease errors in transmission: A checksum is calculated and included in a special field in the header. The pieces by ones complement arithmetic to form the 16-bit Checksum. To provide reliability on a values are pretty stable; For Internet, larger variation of RTTs Internet is a shared resource. If sending rate Probing for bandwidth Increase transmission rate on receipt of ACK, until eventually algorithm that used by IP, TCP & UDP is called Internet Checksum, which is selected because of the channel with bit errors: Use checksum to check for corruption; Use acknowledgment for feedback to timeout duration too short: suffers unnecessary retransmission (premature timeout). If too long: loss occurs, then decrease transmission rate. Continue to increase on ACK, decrease on loss (since ease of implementation in software. This scheme views a message M as a sequence of 16-bit strings. sender; Use sequence # to identify the packets so that the sender and receiver would react in the Delays recovery; performance suffers. Simply measure the RTT to determine the timeout interval is available bandwidth is changing, depending on other connections in network) TCP Slow Start When Add all these 16-bit strings using ones complement arithmetic: carry from most significant bit is added appropriate manner: which packet this acknowledgment packet is responded to & how to differentiate not enough; need an adaptive timeout mechanism. RTT observations Measure RTT from segment TCP connection begins, set CongWin to 1 MSS e.g. MSS = 500 bytes & RTT = 200 msec initial rate = to result. Then take the ones complement of the addition result. In ones complement, converts all the duplicated packets. On a channel with lost and bit errors: Add timeout timer to trigger retransmission. transmission until ACK receipt, denote this as SampleRTT (usually take one measurement per one 20 kbp. Available bandwidth may be>> MSS/RTT: desirable to quickly ramp up to respectable rate. zeros to ones and all the ones to zeros. Resulting 16-bit number is the Internet checksum. Send the Stop-and-Wait is the simplest ARQ scheme, but is known to be quite inefficient: There is only at most RTT) SampleRTT is fluctuating from time to time: TCP maintains a weighted average EstimatedRTT Increase rate exponentially: double CongWin every RTT - incrementing CongWin by 1 MSS for every message together with the checksum to the receiver M & ~X. On the receiver side: Do the same one unacknowledged packet at any time. To improve the efficiency, multiple packets are sent while i+1 = (1-)EstimatedRTTi + i+1 Typical value of the smoothing factor: = 0.125 which is ACK received. Slow Start increases CongWin aggressively - Exponential increase: If allows to checksum operation on the received message M. After complementing, ~(M + ~X) all 0s shows that waiting for acknowledgment. The essence of all pipelined protocols is that at any instant of time, the an influence factor from the past. If variation among samples is small, EstimatedRTT value should be increase without limit, dangerous of overshoot and lose up to half a CongWins worth of data. Slowthere is no error. Reliable Data Transfer Characteristics Data sent by one end are delivered correctly sender maintains a set of sequence numbers corresponding to packets it is permitted to send. better trusted. If variation is large, the timeout value should adjusted appropriately Setting the timeout Start uses another state variable ssthresh. When detects segment loss e.g. timeout: set ssthresh = and completely to the other end, and all are delivered in the order in which they were sent. For some Similarly, the receiver also maintains a receiving window corresponding to packets it is permitted to EstimatedRTT plus "safety margin": larger variation in RTTlarger safety margin. Estimate of how CongWin/2 - remember (half of) TCP rate when congestion last occurred; set CongWin = 1 MSS; applications, this kind of guarantee is important e.g. file transfer. We can implement reliable service at accept. Every time a packet is sent (and not yet ACKed), the number of packets may be sent is much SampleRTT deviates from EstimatedRTT Difference = SampleRTT i+1 - EstimatedRTTi increase rate exponentially until ssthresh; then increase CongWin linearly - going to Congestion Application layer, Transport layer, Link layer. Concept rdt_send() called from above, (e.g. by app) reduced by one. The size of the sender window is fixed. Every time a packet is successfully ACKed, DevRTTi+1 = (1- where is a factor between 0 and 1; recommended Avoidance phase. Initially, ssthresh is set to 64KiB Congestion Avoidance Additive Increase i+ Pass data to deliver to receiver upper layer udt_send() called by rdt, to transfer packet over unreliable the window slides to the right to include one new unsent packet. For Go-Back-N, the size of the value is 0.25. TimeoutInterval = EstimatedRTT + 4 x DevRTT A segment has timeout and been Multiplicative Decrease TCP uses Additive Increase to probe for next congestion level Idea CongWin channel to receiver rdt_rcv() will be called when packet arrives on rcv-side of channel deliver_data() receiver's window is always 1. The receiver is always looking for the expected packet. Any packet retransmitted, an ACK comes back - which ACK this is referred to? The first one or retransmitted increment by one segment per RTT: In practice, increment a little for each ACK; CongWin += called by rdt to deliver data to upper layer rdt2.0 Reliable transfer over a reliable channel. Assume a arriving out of order is discarded and needs to be resent. Size of the sender's window must be less one? No update of Timeout on retransmitted segments. To avoid retransmission ambiguity problem, MSS*MSS/CongWin; additive increase linear. If detection of congestion feedback: Triple Duplicate channel with bit errors but no lost: Underlying channel may corrupt bits in packet during transmission; than 2k. For Selective Repeat, the receiver's window is larger than 1. The receiver is willing to accept TCP does not derive the timeout interval on retransmitted segment by EstimatedRTT and DevRTT. ACKs - Drop the transmission rate by half; multiplicative decrease; Go to the Fast Recovery phase rdt layer can use Checksum to detect bit errors. If received corrupted packet: Correct by any packet within this window range. A packet with a sequence number falls within the receiver Instead, timeout interval is doubled on each failure and retransmission, until the segment gets Timeout - Set ssthresh to CongWin/2; CongWin to 1 MSS; Go to Slow Start phase Fast Recovery retransmission - Automatic Repeat Request or ARQ Requesting a packet transmission be resent window but is not the next expecting packet, will be accepted and buffered by the receiver. Size of through the first time. Congestion is the most likely cause of lost segments; it is likely that the RTT Detection of congestion by timeout: significantly reduces performance due to long delay. Fast Basic elements of ARQ: Error-detecting code to detect transmission errors; Acknowledgment - the sender's and receiver's windows must be at most one-half of 2k. Transmission Control Protocol value will be increased by the congestion; exponential backoff with an upper limit of 64 seconds. For Recovery with Fast Retransmit Detection of triple duplicate ACKs: whenever receiver gets a valid but receiver feedback ACKs (positive acknowledgments) receiver explicitly tells sender that packet (TCP) Reliable data transfer service: Ensure that data is delivered correctly from sender to receiver the next transmission, we reuse the timeout value until the ACK for this segment is received that was out-of-order segment, it immediately sends back an ACK telling which expected seq# it is waiting for: received OK NAKs (negative acknowledgments) receiver explicitly tells sender that packet had errors; in-order; Flow control, sequencing, acknowledgment, retransmission. Congestion control: Prevents not retransmitted TCP Reliable Data Transfer Operates over best effort service of IP Packets can TCP does not use NACK. When there are more than 3 out-of-order segment arrived, this is likely to Sender retransmits packet on receipt of NAK. Stop-and-Wait Source transmits single packet. Wait for any one TCP connection from generating excessive traffic and overflowing the buffer resources in arrive out-of-order, with errors, or be lost. Packets can arrive after very long delays; duplicate data or be a packet loss signal. TCP performs a Fast Retransmit: retransmitting what appears to be missing ACK / NAK. Destination receives packet. Replies with ACK / NAK Fatal Flaw If ACK/NAK corrupted: packet switches between communicating hosts Connection management Services not available ACK segments. Duplicate segments must be detected & discarded. Sequence Numbers Very long segment without waiting for timeout. Fast Recovery: TCP cuts down the transmission rate by half Sender doesnt know whether ACK or NAK. Cant just retransmit: possible duplicate. Handling delay guarantees & bandwidth guarantees Reliability Detecting errors: Transmission errors, Packet seq# (32 bits) to deal with long delays. Initial seq numbers negotiated during connection setup. ssthresh = CongWin/2 CongWin = ssthresh + 3*MSS: account for the three segments that triggered duplicates: Sender retransmits current packet if received unknown acknowledgment; Sender adds loss, Error detecting code, Sequence number; Receivers feedback: Acknowledgment, Duplicate Accept segments within receive window Support piggybacked acknowledgment A data segment also duplicate ACKs. Each time another duplicate ACK arrives: increment CongWin by one segment size sequence number to each packet - give identity to each packet; Receiver discards(doesnt deliver up) ACKs, Negative acknowledgment; Error recovery: Retransmission, Timeout timer Point-to-point carries acknowledgment to the other side. Reduce traffic, save bandwidth. How receiver handles out- and transmit a new segment if allowed by the new value of CongWin. When a non-duplicate ACK duplicate packet if it has received that before rdt2.1 Sender seq # added to packets header. Two Supports a logical channel between two endpoints Full duplex Supports bidirectional communication of-order segments TCP spec doesnt say, up to implementer. Most implementations use buffers to arrived: set Cong Win = ssthresh; Go to Congestion Avoidance phase TCP Congestion Behaviour seq. #s (0,1) will suffice because in Stop-&-Wait sender only has one unacknowledged packet at a at the same time Connection-oriented A logical connection only exists in the end systems: store valid but out-of-order segments TCP Transmission Policy Receive data from application Create When cwnd < ssthresh, sender in slow-start phase, window grows exponentially. When cwnd time. Must check if received ACK/NAK is corrupted. Sender has 4 states: state must remember Intermediate devices do not see/manage this connection. Connection setup and release: segment with seq# (nextseqnum) Three mechanisms to trigger transmission 1 When the amount of ssthresh, sender in congestion-avoidance phase, window grows linearly. When triple duplicate ACK whether current packet has 0 or 1 seq. # Receiver Must check if received packet is duplicate. handshaking to establish connection before data exchange, establish some shared state info; data in send buffer exceed threshold (MSS) 2 URGENT data 3 TCP thinks is time to send: if there is occurs, ssthresh set to cwnd/2, cwnd set to ~ ssthresh. When timeout occurs, ssthresh set to cwnd/2, Receiver has 2 states: indicate whether 0 or 1 is expected packet seq # e.g. if at state 1, receives a Keeping connection state before release; Use of send & receive buffers 1.TCP sends those data at unacked data in transit, buffer data and send it until ACK arrives. Start timeout timer if not already cwnd set to 1 MSS, back to slow-start TCP average throughout as function of window size, RTT packet with seq # 0, discards but sends an ACK (might be previous ACK corrupted, sender its own 2.support asynchronous communication Reliable in-order byte stream With error detection running: TCP uses single retransmission timer, think of timer as for oldest unACKed segment TCP (ignoring slow start) W - window size when loss occurs. When window is W, throughput is W/RTT retransmitted packet with seq# 0 again so retransmit ACK) Receiver can not know if its last ACK/NAK and recovery to deal with IP transfer impairments:checksum, sequence number, flow control, Retransmission Timeout Policy New TCP segment is sent If retransmission timer is not on: set timer Just after loss, window drops to W/2, throughput to W/(2RTT) Assume RTT and W are more-or-less received OK at sender rdt2.2 NAK-free. Same as rdt2.1 but use ACKs only: instead of sending NAK, acknowledgment, retransmission and congestion control. Stream Data Transfer TCP is a stream- to current value of TimeoutInterval; else do nothing. If receive ACK If has unACKed segments, reset constant over a long duration of the TCP connection: TCP transmission rate varies between receiver sends ACK for last packet received OK; Receiver must explicitly include seq # of packet oriented protocol that connects as an imaginary pipe between the two ends: Transfers a contiguous the timer to TimeoutInterval; else clear the timer Timer expires Retransmit the oldest segment; W/(2RTT) to W/RTT; average throughout = 0.75 W/RTT Summary TCP is a stream-oriented being ACKed. Duplicate ACK at sender results in same action as NAK: retransmit current packet stream of bytes. Does not preserve message boundary. TCP packs app data into segments MSS exponential backoff the TimeoutInterval value: double the value protocol that connects as an imaginary pipe between the two ends; where as UDP treats each rdt3.0 channels with errors and loss New assumption Underlying channel can also lose packets maximum segment size: The maximum amount of app data to be placed in a segment; Determined Event at Receiver application message as an individual unit. Each byte in the TCP segment has a sequence number, TCP Receiver action (congestion loss) Checksum, seq#, ACKs, retransmissions will be of help, but not enough. Packet by the carrying capacity (max. transmission unit MTU) of underlying link-layer frame TCP Arrival of in-order segment with expected seq #. Delayed ACK. Wait up to 500ms for next but TCP header only carries the sequence number of the first data byte contained in that segment. not reaching receiver; no ACK. ACKloss data packet reaches receiver, has sent Multiplexing/Demultiplexing TCP allows multiplexing of multiple connections between end systems: All data up to expected seq # already ACKed One important function of 3-way handshaking is to initialize the TCP state variables (e.g. seq #, MSS, segment. If no next segment, send ACK ACK; cant reach sender. In senders view, it doesnt receive any ACK for both cases. Approach Each connection only connects up two endpoints A TCP connection is specified by a 4-tuple (source Arrival of in-order segment with expected seq #. Immediately send single cumulative ACK, AdvertisedWindow) associated with the TCP connection on both sides. Both ends in the TCP must Sender waits reasonable amount of time for ACK. Retransmits if no ACK received in this time. If IP address, source port, destination IP address, destination port) Arriving segment directed according One other segment has ACK pending call the close to teardown the connection. Thus, it is possible that one end has teardown, while the ACKing both in- order segments packet/ACK just delayed (not lost): retransmission will be duplicated, but use of seq. #s already to connection 4-tuple TCP Segment Header fixed 20-byte header + optional (at most 40 bytes) Arrival of out-of-order segment higher-thanImmediately send duplicate ACK, indicating other end still remains open. Another special feature of connection termination is the TIME_WAIT handles this; ACK must include the seq # to which receiver wants to ack. Requires countdown timer Segment size usually bounded by lower link-layer MTU. MSS (max segment size) = maximum state, which allows the TCP stack to response to retransmit FIN because of the ACK is lost. The expect seq. # . Gap detected seq. # of next expected byte to trigger retransmissions: Need to be longer than RTT Performance Utilization: fraction of time amount of app data to be placed in a segment; Each side defines its MSS and sends to the other side retransmission time (Timeout) can be made dynamically by basing on the RTT. As RTT may be Immediate send ACK, provided that segment sender busy sending. Usender = (L/R)(RTT + L + R) Pipelined Protocols Improve Stop-and-Wait by during connection setup TCP Header Sequence Number (32-bit) Every byte on TCP connection has Arrival of segment that partially or completely varied due to the network condition, most formula take some running average as the estimated of starts at lower end of gap not waiting. Pipelining Keep channel busy by continuing to send more packets, increase utilization of its own sequence number. Indicates seq # of the first byte in this segment. Initial sequence number fills gap RTT. TCP decouples the flow control mechanism with its sliding window. Receive an ACK does not sender. Lets allow the sender to send a window of up to N un-ACKed packets in the pipelining. (ISN) selected during connection setup. Short warp around time (seq# reuse after..) 56 kb/s ~ 7.1 TCP Flow Control TCPs sliding window is different from the mechanism used by GBN & SR. slide the sender window forward. It is controlled by the Receive Window which is managed by the Usender = N(L/R)(RTT + L + R) Need to assign sequence number to each packet: the range of days 10 Mb/s ~ 57.2 minutes 1 Gb/s ~ 34.3 seconds Acknowledgment Number (32-bit) Seq# of next TCP senders window is not determined by sender itself and it is not fixed. The size of the TCP receiver. TCP makes use of timeout and duplicate ACKs as the signals of network congestion. If the senders window is limited by the receive window advertised by the peer. Receiver has limited buffers sequence numbers must be increased, (0,1) is not enough. Buffering packets at sender and/or byte expected by receiver. Acknowledges that all prior bytes have been received correctly. TCP uses sender perceives that there is little congestion, then it increases its send rate; if sender perceives that receiver; at least at sender side for retransmission to recover from error or lost. Two forms of Cumulative ACK (like GBN). Valid only when ACK flag is set Header length (4 bits) Specifies the to store arriving packets. There are several situations causing receivers buffer overflow: Senders there is congestion, it reduces its send rate. pipelined protocols: Go-Back-N, Selective Repeat. Sliding Window Protocol Both Go-Back-N and length of TCP header in unit of 4-byte Control flags (6 bits) URG urgent pointer flag: Urgent message transmission rate is faster than the applications data consumption rate; Surges in packet arrivals. Selective Repeat Actions of sender and receiver are confined by a window range of sequence end @ Seq# + urgent pointer i.e. urgent data is contained at the front of the segment body ACK ACK "Reason of flow control": sender won't overflow receiver's buffer by sending too much, too fast; by numbers. As the protocol operates, the window slides forward over the sequence number space. packet flag; indicates this segment carries acknowledgment PSH urge the receiver to pass data to regulating rate at which source is allowed to send information Receive Window The peer tells the Sequence number is stored in packet header, but space allocated to store sequence number is upper app immediately RST reset connection SYN establish connection FIN close connection other end how much buffer space available for this connection. Speed-match send rate to receiving limited. Lets use k bits to store the sequence number: valid range of the number is [0, Receive Window (16 bits) Maximum 65535 bytes. Used by flow control: inform the other side what is applications draining rate. Space remain in Receive buffer: Suppose no out-of-order segment. 2k-1] Sliding window cannot slide to the right without limit. Usually sequence numbers may wrap the available receive buffer on this end at this moment becomes the size of the senders window on RecvWin = RecvBuffer [LastByteRcvdLastByteRead] Advertises unused buffer space by including around and reuse. e.g. k = 8, valid range is [0 .. 255] It is possible that with N = 16 & base = 250, the the other side TCP Checksum Same as UDP, using Internet Checksum Options Variable length at RecvWin in segment header and sends to the peer. Peer is obliged to keep no. of outstanding range in the valid window is [250 .. 9] Go-back-N Sender rdt_send( ) when call by upper app to send most 40 bytes. Timestamp option, Window Scale option, MSS option Maximum Segment Size unACKed bytes below RecvWin: guarantees receivers buffer doesnt overflow Deadlock scenario data Checks to see if the window is not full, then performs packet transmission: Packet uses (MSS) option specifies largest segment a node wants to receive: largest block of data that TCP sends may occur: ACK seg could be lost; However, ACK does not timeout and retransmit; Sender is nextseqnum as its seq#, then increment nextseqnum by 1; Start timeout timer if havent started so. to other end Each end can announce its MSS during connection establishment, Default is 536 blocked. TCP allows sender to send even RecvWin=0: periodically send a 1-byte segment to test; Window == FULL, when have N outstanding, unACKed packets i.e. nextseqnum==base+N bytes. This makes up an IP datagram of 576 bytes including 20 bytes for IP header and 20 bytes for send urgent data when needed Congestion Cause When the number of packets approaches the Cumulative ACK ACK(n) ACKs all packets up to, including seq # n, have been successfully TCP header. Ethernet: MSS of 1460 bytes TCP Connection Management TCP sender, receiver packet handling capacity of the network device Examples all going to the same outgoing line; received at receiver Timeout timer Use a single timer for the oldest outstanding unACKed packet establish connection before exchanging data segments. Connection Setup with Three-Way mismatch of line speeds Congestion Control To avoid a set of senders overrunning the network resources. Dont want the control to be too restrictive. Ideal case Elastic utilization of network

Link Layer Data-link layer has the responsibility of transferring datagram from one node to adjacent Bluetooth, FDDI, IBM Token Ring Random access Station always transmit at full rate of the Binary Exponential Backoff Goal - Avoid lockstep retransmission and have adaptive retransmission: works as a store and forward device. More intelligent device as compared to repeater: Examine node over a physical link: The 'simplest' network is a network with two nodes interconnected by a link channel. When there is collision, each node involved in the collision repeatedly retransmits its frame Under heavy load - wait longer, Exponential increase. Light load - short delay. When transmitting a frame header and selectively forward frame based on its destination addressing info. When IP datagram is encapsulated in a link-layer frame and transmit over the physical link. On the way from by waiting a random delay before retransmission e.g. Ethernet, WiFi Channelization Approaches given frame: First collision wait either 0 or 1 slot times: With each time slot, we have K = 512-bit forwarding frames, use CSMA/CD to access outgoing segment and transmit. In todays networks, source IP node to destination IP node, a datagram may be carried on different physical links in the Frequency Division Multiple Access (FDMA) Frequency band allocated to users: Each station transmission times; a bit time in 10 Mbps is 0.1 microsecond Second collision choose {0,1,2,3}*K time hosts usually have dedicated, direct connection to switch: each link has its own collision domain Adv path: datagrams is transferred by different link-layer protocols over different links e.g. WiFi on first transmits and listens on assigned bands e.g. Broadcast radio & TV, analog cellular phone Time units Third collision choose {0,1,2,,23-1}*K time units. After ten or more collisions, choose {0,1,2, . . Isolates collision domains: needs buffers to buffer frames if all the domains send at the same time link, Fast & Gigabit Ethernets on intermediate links, WiFi on last link. However, different link-layer Division Multiple Access (TDMA) Periodic time slots allocated to users: Dedicate 1 slot per station in ,210-1}*K time units. After 16 collisions, report failure to upper layer Why Minimum Frame Size Worst- Supports heterogeneous links: each port in its collision domain; thus can operate at different speeds protocol may provide different services e.g. different frame sizesdifferent MTU; different frame transmission cycles. Stations transmit data burst at full channel bandwidth e.g. Telephone backbone, case scenario Let propagation delay between two farthest stations A & B be d pg At t0, station A starts Allows multiple simultaneous transmissions: switching frames: A-to-E and B-to-D simultaneously, structures Link Layer Services Framing Encapsulate datagram into frame by adding header and GSM digital cellular phone Code Division Multiple Access (CDMA) An encoding scheme with different transmitting. At dpg , just before the signal arrives to B; B starts transmitting. Collision, so B stops without collisions; not possible with dumb hub. Transparent: hosts are unaware of presence of trailer Link access When multiple nodes share a single shared medium, how can all nodes effectively codes are used for different users: CDMA assigns a different code to each node; Each node uses it The corrupted signal does not get back to A until time 2dpg switches; No modification to content or format of frame; Exact bitwise copy of frame. Plug-and-play, utilize the shared medium? Medium Access Control Need some mechanism to coordinate the unique code to encode the data; If the codes are chosen carefully, different nodes can transmit to transmit at least 2dpg units of data. If frames are shorter, jam signal cannot get back on time, and self-learning: switches do not need to be configured Self-learning Use backward learning to build frame transmissions of multiple nodes. MAC addresses used in frame headers to identify source & simultaneously and yet the transmissions can be received correctly e.g. Cellular phones, 3G cellular the sender just claims that it has successfully sent. A station needs 2dpg to find out if channel has forwarding table: When frame arrives at port X, it comes from a host in the LAN (network segment) destination Reliable delivery between adjacent nodes Seldom used on low bit-error links (fiber, some Taking-Turns Protocols Polling protocol A master node transmits polling messages to stations been captured IEEE 802.3 Original Parameters Transmission Rate: 10 Mbps Min Frame: 512 bits = attached to port X; Use the source address to update forwarding table for port X to include that At a bit rate 10 Mbps, we address Forwarding decision Forwarding procedure: If incoming frame (at port X) is destined to a twisted pair) Useful for links that have high error rates, e.g. wireless links Flow control Pacing according to a certain order . The polled station may send data up to some limit. Concerns: polling 64 bytes: Max Length = 2500 meters (with at most 4 repeaters) 2 dpg between adjacent sending and receiving nodes Error detection Errors caused by signal attenuation, overhead; latency; single point of failure (master) e.g. WiFi under PCF mode data Token-passing need at least 500 bits. If a station receives a frame <64 bytes, it must be a garbage frame (runt host which is in the same LAN (associated to port X) - don't forward; if entry found on the table (i.e. interference by noise; receiver detects presence of errors: signals sender for retransmission or drops protocol A permit (token) for frame transmission is passed from station to station according to a frame) As the network speed goes up: Decrease in dpg (distance) e.g. Fast Ethernet (100 Mbps) limits destination is known) - forward the frame to the indicated port/interface; else is unknown - flood to all frame Error correction Receiver identifies and corrects bit error(s) without resorting to retransmission certain order. Stations must capture token before transmitting. Concerns: token overhead; latency; the maximum length of the network to 250 meters OR Minimum frame length must go up e.g. interfaces except the incoming one Table Maintenance In a static network, tables eventually store all Half-duplex and full-duplex With half duplex, nodes at both ends of link can transmit, but not at same single point of failure (token) e.g. FDDI Random Access Protocols When node has packet to send: Gigabit Ethernet (1000 Mbps) requests NIC to add its own padding after normal frame to extend the addresses & learning stops. Limited forward table size. In practice, stations are added & moved all time Framing The physical layer is moving data as a sequence of bits. Upper layers work with a block transmit at full channel data rate R; no a priori coordination among nodes. Two or more nodes minimum transmission to 4096 bit-times (512 bytes) 802.3 Ethernet Standards: Link & Physical the time: Handle dynamic topologies Introduce timer (minutes) to age each entry & force it to be of data, not bit streams. The data link layer needs to find some way to break/organize the sequence transmitting at the same timecollision Random access MAC protocol specifies: how to detect Layers Many different Ethernet standards: common MAC protocol# and frame format; different relearned periodically - when a frame from a known source arrives, update the timestamp to current of bits into a frame. Dividing bit streams into frames: simplifies the control e.g. using error control collisions & recover from collisions (e.g. via delayed retransmissions) Examples of random access speeds: 10 Mbps, 100 Mbps, 1Gbps, 10 Gbps, 40 Gbps, 100 Gbps different physical layer media: time; Purge all entries that are beyond the aging time - no frames are received with that source scheme, link layer protocol can detect transmission errors and, if necessary, correct errors. With a MAC protocols: ALOHA / slotted ALOHA CSMA, CSMA/CD, CSMA/CA Pure Aloha Packet radio fiber, cable IEEE 802.11 Wireless LAN Wireless LAN devices use radio frequencies: 2.4-2.485 GHz address for some time; If frame arrives on port that differs from frame address & port in table, update well-defined frames start & end parts, the receiver will be able to identify the whole frame. The network: Provide data transfer between main campus & remote campuses of University of Hawaii. (802.11b/g/n) or 5.1-5.8 GHz (802.11a/n) band. Data Rate: up to 600 Mbps. Frame structure is immediately Router - Layer 3 Switch L2 switch makes use of MAC addresses for forwarding decision structure of the frame is specified by the link layer protocol. Typically implemented by network Simplest solution: just do it. A station transmits WHENEVER it has data to transmit. If more than one similar to 802.3 Ethernet: Frame data payload could be as large as 2312 bytes. But usually carries Router makes use of L3 (Network) addresses: Need more processing time; Not a transparent device adaptor (hardware) Sentinel-based Character-Oriented Frames consist of integer number of bytes: frame is transmitting, they interfere with each other: receiver detects about the error and drops the <1500 bytes. Infrastructure network Connect to the wired Ethernet infrastructure via the APs Ad hoc (or in other words, not a plug-&-play) - Hosts must explicitly set up to use the routers; No restriction receiving NIC collects each 8-bits and interprets/processes it. Header & Data (& trailer) portions are frame; sending station waits for ACK. If receives ACK, fine. If not, waits random backoff time and then network Wireless stations can dynamically form network without AP: Temporary association of group on the topology - Cycles (redundant paths) are allowed; Protection against L2 broadcast storm contained between special flag byte at the start and end e.g. PPP (point-to-point protocol) using retransmits. If no ACK after repeated transmissions, give up Performance of Aloha Aloha works well of stations that are within range of each other 802.11 Architecture Basic Service Set (BSS) Group of Summary Ethernet uses CSMA/CD. It uses carrier sensing to first avoid creating collision. Station 01111110 Technical issue The flag byte may appear in the Data portion (payload) Is received ONLY when there is one active node: Each time when more than one active node sending, collision stations that coordinate their access to the medium. Stations in BSS can communicate with each keeps on sensing the channel during transmission; if detects collision, sends a short jamming signal and aborts the transmission. It uses the exponential backoff algorithm to schedule a future resensing 01111110 a data byte or flag byte? Solution: Byte stuffing - Sender adds a control 'escape' byte occur. The no. of collisions raises rapidly with increased active nodes. Increase active before the flag data byte e.g. PPP uses 01111101 as the escape byte. The system views the frame a nodesincrease traffic loadincrease collisionsincrease retransmissionsincrease traffic load time. Because of the hidden station problem and it is highly complex and expensive to support sensing during transmitting, CSMA/CD does not work on wireless LANs. Wireless has two modes of collection of bits, is not concerned with byte boundaries. For example, HDLC (High-Level Data Link The maximum utilization of the channel is about 18.4% only What's wrong with Aloha They don't pay Control) using bit pattern 01111110 as the flag. Same problem as byte-oriented: special pattern attention to what others are doing Carrier Sense Multiple Access Listen to the network to detect what operation in supporting random access. DCF CSMA/CA Carrier sensing the channel before appears in the payload. Solution: Bit stuffing. Sender: insert a zero after five consecutive ones; other stations are doing: Avoid transmissions that are certain to cause collisions. Protocols in which transmits; if idle, waits for DIFS before transmitting. If the channel is busy, it defers by a random backoff time to schedule the reattempt. After transmission, the sender waits for ACK from the Receiver: when it detects a zero that follows five consecutive ones, delete it. If after five ones, next stations listen for a carrier and act accordingly are called carrier sense protocols. Collisions can still bits are 10, this is frame marker Error Detection Process An error detection value is first calculated by occur: If two sending stations are far away, propagation delay between two stations means they may receiver. If missing of ACK, the sender waits for a longer backoff time for the reattempt. DCF CSMA/CA MACAW: A handshaking procedure to avoid hidden station problem. The protocol allows a the sender and transmitted along with the data. At the receiving end, the error detection value is not hear each others transmission CSMA with Collision Detection With CSMA and Aloha, collisions recalculated and checked against the received value. If they differ, an error has occurred. Error involve entire frame transmission. CSMA/CD: Monitor for collisions & abort transmission - Stations station to use a short RTS frame and a short CTS frame to reserve access to the channel. The CTS detection uses the concept of redundancy, which means adding extra bits for detecting errors at the with frames to send, first do carrier sensing; After beginning transmissions, stations continue listening frame instructs the other stations (that are within range) not to send for the reserved duration. Switches forward packets based on MAC addresses rather than on IP addresses. Switches use the destination Single Parity Check Parity checking is one of the oldest and simplest error detection to the medium to detect collisions; If collisions detected, all stations involved stop transmission techniques. Append an overall parity check to k information bits. For even parity, the sum of the bits CSMA-CD reduces channel wastage to the time of detecting collision and abort transmission. Easy to self-learning method to build the forwarding table. To detect dynamic changes of topology, switches delete out aged entries from the table. Switches are working fine as long as there are no redundant (including the parity bit) remains even. For odd parity, the sum remains odd. Receiver checks to see if detect in wired LANs: measure signal strengths, compare transmitted and received signals. Difficult in # of ones is even or odd. All error patterns that change an odd # of bits are detectable. Parity wireless LANs: received signal strength overwhelmed by local transmission strength Summary paths (cycles). checking is simple, but doesn't catch all errors: If two (or an even number of) bits have been changed Framing involves identifying the beginning and end of a block of information within a digital stream. other. Distinct collocated BSSs can coexist IEEE 802.11 MAC CSMA/CD not well enough for at the same time, the parity check appears to be correct even though an error has occurred Two- Please note that framing is based on the assumption that the receiver knows how to identify an wireless: Difficult to detect collision while transmitting; The signal strength is too strong at the adapter. Dimensional Parity Check More parity bits to improve coverage. A parity bit for each row and for each individual bits. The available methods to delineate a frame are: by means of special characters to Cannot assume that all stations can hear a collision: Hidden station/terminal problem (HSP) 802.11 column. Catching over 98% of all errors, but still misses significant number of errors. 1/2/3 errors can identify beginning and end of frame; by means of special bit patterns. The principle of error checking supports two modes of operations Distributed Coordination Function (DCF) Contention Service: Best always be detected; Not all patterns >4 errors can be detected Cyclic Redundancy Check View k data is by adding extra information to the original message block. Those extra information are generated effort: CSMA/CA (default), CSMA/CA MACAW (Optional) (Optional) Point Coordination Function bits (D) as a binary number. A r+1 bit pattern (generator G) is used for generating the checking bits according to some mathematical principles. By applying the same algorithm on the receiving side, the (PCF) Taking-Turns Protocol - by Polling, Contention-Free Service Interframe Spacing Interframe We want r << k e.g. r = 32 and k = 12,000 (1500 bytes) Goal: generate an r-bit CRC (R) such that the receiver can determine if errors have been introduced. The simplest scheme is the single parity Space (IFS) - All stations are obliged to remain quiet for a certain minimum period even if the channel transmitted message (T) is divisible by G: T is composited by concatenating D with R. T=<D,R> check, which appends a single check bit to k data bits to form a codeword. The parity check ensures is found idle: A distant station may have already started transmitting, wait IFS time allows the signal exactly divisible by G (modulo 2) Receiver knows G, divides received T by G. If non-zero remainder: that the total number of 1s in the codeword is even (for even parity). Using the same principle, we can to reach this listening station. For all access methods, several parameters for controlling the waiting error detected! Can detect all burst errors less than r+1 bits. Burst error of length B means contiguous extend the single parity check to two-dimensional parity checks, which gives a better error checking time before medium access are important. High-Priority frames wait Short IFS (SIFS) Typically to sequence of B bits in which first, last and any number of intermediate bits in error. Widely used in performance than single parity check. Cyclic Redundancy Check is a powerful scheme that bases on complete exchange in progress ACKs, handshaking etc. PIFS to initiate Contention-Free Period practice (Ethernet, 802.11 WiFi, ATM) CRC Concept CRC codes are also known as polynomial polynomial code. Given a k-bit information block, the sender generates r-bit sequence, such that the DIFS to transmit data during DCF Distributed Coordination Function CSMA/CA Sender Detects codes: treat bit strings as polynomials with coefficients of 1&0. Represent n-bit message as n-1 resulting transmitted message contains n = k+r bits, which is exactly divisible by a known divisor channel is idle, waits DIFS time, if still idle, transmits. If channel busy, defers until channel idle plus = x7 +x4 +x3 +x1. Polynomial arithmetic modulo 2: Addition and polynomial between the sender and receiver. To support correction of 1-bit error, for a data unit of k DIFS, DIFS then adds a random backoff time (in unit of slots), and counts down. If channel engaged r + R. T is exactly divisible by bits, use the formula 2r k + r + 1 to determine r, the number of redundant bits needed. Multiple subtraction are identical to XOR. There are no carries. before timer expires, freezes the timer and resumes countdown when idle again. If channel idle when r +R = nG; r = nG+R r by G, we get R. We can view a Access Networks have a single channel that is used by all communications. The key design issue is timer expires, starts transmission. If channel busy when timer expires, restarts the process with a transmission with error as T + E: E is the error pattern XOR (+) to the transmitted bit pattern; E = 0 the allocation mechanism. Random access approaches are relatively simple to implement. Under longer backoff time (exponential backoff) If no ACK, uses binary exponential backoff algorithm and means no error. Receiver divides (T + E) by G; remainder zero if: E was zero (no error) or E is exactly light traffic, we can experience low-delay frame transfer. However, the randomness in the access can retries. If has another frame to transmit, executes the random backoff first Receiver After receipt, the divisible by G Error Correction Forward error correction (FEC) Receiving device can correct incoming limit the maximum achievable throughput and can result in large variability in frame delays under receiver waits SIFS before sending the ACK CSMA/CA MACAW (Optional) A handshaking protocol. error messages itself. Extra corrective information needs. The amount of extra information needed is heavy traffic load. Aloha is a classical example of random access network: the nodes transmit Allow sender to reserve channel rather than random access of data frames. Sender first transmits usually quite a lot: e.g. a system with 1-bit FEC capability, We have k bits data + r bits redundancy, whenever they have data to be sent. When the state of the channel can be sensed, nodes can avoid small request-to-send (RTS) packets: RTSs may still collide with each other (but theyre short); and let N=k+r; We need to use N+1 states to indicate one state with no error and N states to locate starting a transmission while another station is transmitting Carrier Sensing. Ethernet is the most avoid data frame collisions completely using small reservation packets. Receiver broadcasts clear-towhere is the error; We have r checking bits that, at most, indicate 2r different states. 2r > N+1 > k+r+1; prevalent wired LAN. Cheap, therefore becomes a built-in (standard) PC component. Continue to send CTS in response to RTS. All frames carry info about the duration of the occupation of the e.g. for k=7, r 4 Useful for one way transmissions or when transmission times are very long (e.g. evolve by keeping up with the performance. Originally developed by DEC, Intel and Xerox. Roots in media. CTS heard by all nodes that are close to the receiver: avoids Hidden terminal problem; other communications to spacecraft) Hamming Code - one example of FEC techniques MAC Addresses Aloha packet-radio network. Offers an unreliable connectionless service Topology Bus topology stations defer transmissions by adjusting their NAV (Network Allocation Vector) to mark the channel and ARP 32-bit IP address Network-layer address. Uniquely identifies a device's interface on the popular before mid 90s: all nodes in same collision domain (can collide with each other) Star topology as busy for the duration. Sender transmits data frame 802.11 Frame Structure There are four address network. Used by routers to forward datagram to destination IP subnet MAC (or LAN or physical) hub-based (late 90s): still working in single collision domain Star topology switch-based (current): address Actual data delivery task is done by the link layer. To deliver data across link layer, need each link runs a (separate) Ethernet protocol (no collision with each other) Ethernet Frame Structure MAC address: get a frame from one interface to another physically-connected interface (in same Frame Format Bit-oriented framing protocol Preamble 7+1 bytes (64-bits) 7 bytes of 10101010 fields (as compared to two in Ethernet): The meaning of the address fields depends on the contexts, subnet) 48 bit MAC address (for most LANs) burned in NIC ROM, also sometimes software settable generate a square wave: helps receiver synchronize its clock with transmitter. Last byte changes to e.g. in ad hoc network, AP to AP and to & from Internet when operating under Infrastructure network; Address Resolution Protocol (ARP) Given IP address of destination B, how to determine MAC defined in the Frame Control field Example From a mobile device X through the AP to router R (to address of B? If B is not on the same IP subnet, you dont need that; instead, you need the MAC Internet): Address1 - APs MAC address, Address2 - Xs MAC address, Address3 - Rs MAC address address of nexthop router. If B is on the same IP subnet, use ARP to find that. Mapping IP address to From router R (from Internet) to mobile device X through the AP: Address1 - Xs MAC address, MAC address Host A broadcasts ARP query packet, containing host B's IP address: asking who 10101011 (sentinel) Additional mechanism Manchester encoding Every bit interval has a transition Address2 - APs MAC address, Address3 - Rs MAC address. In summary, address 1 and 2 contain owns IP a.b.c.d? Set dest MAC address to FF-FF-FF-FF-FF-FF; All machines on the same IP subnet in middle: mid-bit transition; Transition serves as clock and data representation. Used in 10-Mbps the destination and source MAC addresses of the stations within the wireless network Hub/Bridge/ receive ARP query. Only host that has IP a.b.c.d sends back the ARP reply: B receives ARP packet, Ethernet Addresses (6 bytes) e.g. 00:06:5B:73:31:93 MAC address allocation administered by IEEE: Switch/Router Connecting devices. Repeater interconnected at physical layer Bridge/Switch replies to A with its (B's) MAC address; frame sent to As MAC address (unicast) Each IP node has a manufacturer buys portion (high-order 24 bits) of MAC address space (to assure uniqueness) For interconnected at data link layer Router interconnected at network layer Gateway interconnected ARP table for caching < IP address; MAC address; TTL> TTL time after which address mapping will broadcast, all 1s. If adapter receives frame with matching destination address or with broadcast at higher layers interconnected means the only information or the extent of the information that the be forgotten (typically 20 min) ARP caching ARP request (broadcast) carries source MAC address + address, it passes data in frame to network layer. Otherwise, adapter discards frame. Type Indicates devices understand Repeater A physical-layer device that acts on individual bits rather than frames source IP address Only target host stores/caches this info. Target host reply ARP reply with MAC protocol carried (or encapsulated) by this frame (mostly IP but others possible, e.g. Novell IPX, Regenerates the original bit pattern to the other cable. Transmits in both directions. Two segments addr: only cache by receiving source machine Medium Access Control One important type of AppleTalk, ARP) CRC: CCITT-32CRC Covers addresses, type, & data Data (46 to 1500 bytes) connected by a repeater are one single network (of the same collision domain) Collision domain physical link is the Multiple Access (Broadcast) link: M users communicate by sharing the same Minimum requirement is 46 bytes. If network layer passes in small data (<46), pad to fill out to 46 Whenever one machine within this domain wants to transmit data, it has to contend with all the physical channel. All nodes need to find some means to share the single communication channel. bytes. MTU is 1500 bytes. NIC discards frames with improper lengths or failed CRC Ethernet: machines in the same collision domain for the network resources using the media access protocol. Whenever 2 frames are "injected" into the channel simultaneously, collision occurs and the resulting Multiple Access CSMA/CD If detects medium idle for 96 bit times: sends immediately; upper bound Whenever one segment transmits a signal, the other nodes have to keep quiet Hub Essentially a signals become garbled. No two simultaneous transmissions are allowed Approaches There are payload size of 1500 bytes. If busy, listens the network to become idle, then waits 9.6 bit times and multiport repeater. Bits coming in one link go out all other links at same rate. No frame buffering Pros three major forms of control Channelization Divides the physical channel into multiple logical transmits (if still idle) If successfully transmits entire frame without collision, NIC is done with frame. If Simple and cheap device that connects more than two host machines Cons Do not isolate collision channels and dedicatedly assign each one to individual user Take-turns This approach attempts to collision detected, aborts & transmits a jam signal (48 bits), then ceases transmission: ensure that the domains: all connecting segments shared a single segment throughput. Cannot connect different produce an orderly access to the transmission channel like polling, token passing etc. e.g. WiFi, collision is sufficient long to be noticed by the others. After jam, waits random time then starts again: Ethernet types Switch link-layer device: smarter than hubs because it takes an active role. Usually

Vous aimerez peut-être aussi