[Back to Lecture Notes page]
The Internet Transport Protocols
Sub-topic outline:
- The Internet makes use of two transport layer protocols over IP:
- Transmission Control Protocol
(TCP)
- Provides a reliable end-to-end stream over an unreliable internetwork.
- User Datagram Protocol
(UDP)
- Simple and efficient, but no guarantee on reliability.
The Transport Control Protocol (TCP)
- When an application wants to send messages out:
- It gives message to the TCP transport entity (a piece of software)
- The TCP entity breaks the message into smaller pieces
- Passes the pieces to IP to send out as separate IP packets.
- Waits for acknowledgements for all pieces, and re-transmit if time-out.
The Transport Control Protocol (TCP)
- When the packets arrive at the destination:
- The TCP entity takes the separate packets from IP perhaps out of order.
- Puts the different pieces together
- Gives the reconstructed message to the appropriate application.
- Gives IP an acknowledgment message to send back to source.
- IP do not guarantee reliable delivery (eg. handle lost or out-of-sequence packets), so TCP needs to handle it.
The TCP Service Model
- Both sending and receiving TCP entities create points called sockets.
- Each socket has an IP number (32-bits for IPv4) and a 16-bit local number, called a port.
- This 48-bit number forms the address for the connection.
- Some particular well-known ports are reserved for standard application services. Eg.
The TCP Protocol
- TPDU are sent as segments, consisting of:
- a fixed 20-byte header part
- a variable-size header part
- The size of the segments is limited by:
- The maximum size of the IP packets
- The maximum transfer unit (MTU) of the network.
The TCP Protocol
- TCP uses a sliding window protocol
- When a sender transmit a segment, it starts a timer
- When a segment arrives at a destination, the receiver sends back a segment with acknowledgment
- If sender times-out, the same segment is re-sent.
The TCP Segment Header
Figure 6-24 p526
- Source
and Destination ports address for the end points of the connection
- Sequence
and Acknowledgement numbers to ensure reliable delivery
- Header length
how many 32-bit words in the header needed because Options field is variable.
- 6 bits reserved still unused today
- Window size
for flow control using a sliding window
- Urgent Pointer
indicates how much interrupt signal data are coming
- Options
to specify other parameters not included in the normal header eg. maximum segment size the receiver is willing to accept.
Note: Due to the lack of time, I didn't go through the next three sections (on TCP Connections, Congestion and Timer management) during the lectures. Therefore, you will not be required to know the material for exam. I include the brief notes on them here anyway for those interested.
TCP Connection Management
- Connection Establishment: 3-way handshake:
- Uses the SYN bit flag set to 1 for segments to establish connection.
- Connection Termination: 2-way handshake
- Uses the FIN bit flag set to 1 for segments to terminate connections.
- Uses timers to avoid the two army problem if no response from other party, the connection is released regardless.
TCP Congestion Control
- More appropriate to deal with congestion at the transport layer rather than the network layer since the senders have the most power to control the flow.
- Two types of congestions: network and receiver
- TCP software at the sender keeps two windows:
- A receiver window indicated by the receiver on how much it can take, and
- A congestion window kept by the sender for congestion in the network.
TCP Timer Management
- Timers are used for segments sent out and awaiting acknowledgments but how long to set the timeouts?
- Much harder problem than the timers used for DLL the possible round-trip times are spread over a much wider range.
- TCP uses a variable (RTT) for each connection continually adjust this variable based on detected network performance.
User Datagram Protocol (UDP)
- An alternative to TCP for transporting IP packets
- Doesnt involve the overheads of making a connection
- Doesnt provide reliability, but much more efficient.
- Used when the data sent are not critical (eg, ICMP echo packets used in pings).
- UDP header: Fig 6-34 p542
[Back to Lecture Notes page]