Presentation is loading. Please wait.

Presentation is loading. Please wait.

What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host IP treats a computer as an endpoint of communication Best.

Similar presentations


Presentation on theme: "What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host IP treats a computer as an endpoint of communication Best."— Presentation transcript:

1 What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host IP treats a computer as an endpoint of communication Best effort delivery -- no guarantees

2 What Do Your Applications Need? Individual packets go to their own applications – Your machine may run multiple applications simultaneously Outlook, Firefox, Windows Media Player. Different levels of services – Every bit of information should be received correctly. Email – Can tolerate some information loss Streamed media

3 Transport Layer Services Transport layer provides end-to-end connectivity across the network – Virtual communications via TCP software

4 Endpoint Identification with Protocol Port Numbers Port numbers – Independent of the OS All computers running TCP and UDP recognize the standard protocol port numbers TCP and UDP must provide a mapping between protocol port numbers and the program identifiers that the OS uses

5 Well-Known Port Numbers 22: SSH 25: SMTP 80: HTTP http://en.wikipedia.org/wiki/List_of_TCP_and _UDP_port_numbers http://en.wikipedia.org/wiki/List_of_TCP_and _UDP_port_numbers

6 Layer 4 Packet: Segment Segments carry application data across the network Segments are carried within IP datagrams within frames 802.11App, e.g., HTTPIPTCP Frame Segment Datagram

7 Transport Layer Services TCP/IP suite contains two transport protocols. – User Datagram Protocol (UDP) – Transmission Control Protocol (TCP) UnreliableReliable MessagesUDP? Stream?TCP

8 Comparison of Transport Protocols TCP is full-featured, UDP is a glorified packet TCP (Stream)UDP (Message) ConnectionsConnectionless Point-to-point communicationArbitrary Interaction Bytes are delivered once, reliably, and in order Message may be lost, reordered, duplicated Arbitrary length contentLimited message size Flow control matches sender to receiver Can send regardless of receiver state Congestion control matches sender to network Can send regardless of network state

9 UDP: User Datagram Protocol

10 User Datagram Protocol Used by apps that don’t want reliability or stream service – Voice-over-IP (unreliable) – DNS, RPC (message-oriented) – DHCP (bootstrapping, multicast) Arbitrary Interaction – 1  1; 1  N; N  1; or N  M Best-effort delivery via IP – Lost, duplicated, delayed, delivered out-of order, corrupted

11 User Datagram Protocol Places the data in a single message for transmission – In practice, choose message size that fits in a standard MTU (e.g., 1500 bytes) 1400 or 1450 to leave space for IP and UDP headers Pros: – Applications preserve data boundaries Cons: – Each UDP message must fit into a single IP datagram – UDP message size can lead to inefficient use of the network

12 UDP Datagram Format Each UDP message is called a user datagram and consists of two parts: – a short header that specifies the sending and receiving application – a payload that carries the data being sent

13 UDP Checksum and Pseudo Header Checksum: An optional, 16-bit field may be used by the destination host to verify whether the message reaches the correct destination. – All bits set to 0 if unused When computing the checksum, UDP software includes a pseudo header:

14 Using the Pseudo Header The destination host must obtain the UDP length, and the source, destination, and type field from the IP datagram to verify the checksum value. The pseudo header is NOT part of the UDP datagram and NOT transmitted with the datagram.

15 TCP: Reliable Transport Service

16 Challenges To achieve efficient, reliable data transmission, a transport protocol must face several major problems: – Unreliable underlying IP service – End system reboot – Heterogeneous end systems – Congestion

17 Sequencing Handle Duplicates and Out-of- Order Delivery Each packet has a sequence number. The receiver stores both the sequence number of the last packet received in order and packets arriving out of order The receiver examines the sequence number – Expected packet – Packet out of order – Duplicated

18 TCP Last packet # in order: Packets out of order: 7 23 Application 12 3 4 5 5 3

19 Retransmissions Handle Lost Packets Whenever a frame arrives intact, the receiver sends a small ACK message that reports successful reception The sender ensures that each packet is transferred successfully – Whenever it sends a packet, the sender starts a timer 5 43210 5 43 ACK

20 Connection Establishment Both sender and receiver must be ready before we start the data transfer Three-Way Handshake: To establish connections reliably, TCP exchanges three messages to ensure unambiguous agreement. – SYNs are retransmitted if lost

21 Connection Establishment Sequencing: To establish connection, TCP requires each side to probe the other with a fresh Initial Sequence Number – A randomly generated 32-bit number

22 Connection Establishment Three steps: – Host 1 sends SYN(x) – Host 2 replies with ACK(x+1) + SYN(y) – Host 1 replies with ACK(y+1)

23 Connection Establishment Q: Why choose a random number as the Initial Sequence Number for each connection, instead of using “1”? 1.Two computers agree to communicate at 1 PM 2.One computer sends a sequence of 10 packets to the other 3.A hardware problem causes packet 3 to be delayed 4.Routes change to avoid the hardware problem 5.Protocol software on the sending computer retransmits packet 3 and sends the remaining packets without error 6.At 1:05 PM the two computers agree to communicate again 7.After the second packet arrives, the delayed copy of packet 3 arrives from the earlier conversation 8.Packet 3 arrives from the second conversation Extraordinarily long delay  Replay Error!

24 Connection Termination The three-way handshake used to close a connection uses FIN segments.


Download ppt "What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host IP treats a computer as an endpoint of communication Best."

Similar presentations


Ads by Google