Datagram Transmission Datagram sent across conventional network –From source host and router –Between intermediate routers –From final router to destination host Network hardware does not recognize –Datagram format –IP addresses Encapsulation needed
IP Encapsulation Entire datagram treated like data Frame type identifies contents as IP datagram Frame destination address gives next hop
Frames and Datagrams Datagram survives entire trip across Internet Frame only survives one hop Frame address –Hardware (MAC) address –Next hop Datagram address –IP address –Ultimate destination
Frame Address For Encapsulated Datagram A datagram is encapsulated in a frame for transmission across a physical network. The destination address in the frame is the address of the next hop to which the datagram should be sent; the address is obtained by translating the IP address of the next hop to an equivalent hardware address.
Window Advertisement Each acknowledgment carries new window information window advertisement –Can be zero closed window) Interpretation: “ I have received up through X, and can take Y more octets. ”
Startup and Shutdown Connection startup –Must be reliable Connection shutdown –Must be graceful Difficult WHY ?
Why Startup/Shutdown Difficult? Segments can be –Lost –Duplicated –Delayed –Delivered out of order –Either side can crash –Either side can reboot Need to avoid duplicate “shutdown” message from affecting later connection
TCP’s Startup/Shutdown Solution Uses three-message exchange 3-way handshakeKnown as 3-way handshake Necessary and sufficient for –Unambiguous, reliable startup –Unambiguous, graceful shutdown SYN used for startup FIN used for shutdown
TCP Segment Format (1) All TCP segments have same format –Data –Acknowledgment –SYN (startup) –FIN (shutdown) Segment divided into two parts –Header –Payload area (zero or more bytes of data)
TCP Segment Format (2) Header contains –Protocol port numbers to identify Sending application Receiving application –Bits to specify items such as SYN FIN ACK –Fields for window advertisement, acknowledgment, etc.