120 likes | 149 Views
Learn how TCP ensures reliable data transmission and how FTP facilitates file transfers in the Internet architecture. Understand the protocols, processes, and analysis involved in transmitting data packets via TCP. Explore sequencing, acknowledgments, and window control for efficient communication. Discover retransmission control strategies for enhanced reliability. Follow along with an experiment to understand network performance and bandwidth usage.
E N D
TCPand FTP Internet Engineering
TCP (Transport Control Protocol) • Protocol of transport layer • Reliability(guarantee packet arrives to destination) • Retransmission control • Use for File ・Mail・Web Transfer FTP HTTP POP SMTP IMAP FTP (File Transfer Protocol) POP (Post Office Protocol) SMTP (Simple Mail Transfer Protocol) IMAP (Internet Message Access Protocol) HTTP (Hyper Text Transfer Protocol)
Hierarchy Architecture sender receiver data data addition analysis TCP header TCP header data data addition analysis IP header IP header data data addition analysis Ethernet Frame header Ethernet Frame header data data Send out revceiv Communication medium (LAN cable・Optical cable ・wireless)
Sender port number Receiver port number (16bit) (16bit) Sequence number (32bit) Acknowledgement (ACK) number (32bit) Reserved Header length Window size ACK PSH PST FIN SYN URG (4bit) (6bit) (16bit) Check sum Urgent Pointer (16bit) (16bit) ( Options ) Data TCP Packet, TCP Header Ethernet Header IP Header TCP Header Data
TCP Header • Sequence number • Indicate the position of sent data • Increased by the number of bytes whenever data sent (※ In ns-2, it is increased 1 when a data is sent ) • Acknowledge (ACK) number • Sequence number of data should be received next • This means that the receiver received all packets whose sequence numbers are less than the ACK • If the sequence number of next data equals the replied ACK number, normal communication is done (※ In ns-2, the ACK number is the maximum sequence number of data received cumulatively. It means that, if the sequence number of sent data equals ACK number, the communication has no fault)
Reliability Insurance by ACK Sequence number 1 2 3 Sender Data Packet ACK Receiver Next is 2 Next is 3 Next is 4 ACK Number It is inefficient to acknowledge individually each segment received. Send a number of segments at once ?
Implement Window Control Window Sequence number 1 2 3 4 5 6 7 8 9 10 11 12 Sender Data packet ACK Receiver 2 Next is 3 4 5 6 7 8 9 10 ACK number No waiting ACK for sent segment but send a number of segment ※ Window size:size of segments can be sent without waiting for ACK
Improvement speed by Window Control • Adjust transmission rate by changing window size Window Size = 1 segment Window Size = 4 segments Sequence number Sequence number 1 2 3 1 2 3 4 5 6 7 8 9 10 11 12 Sender Sender Data Packet Data Packet ACK ACK Receiver Receiver 2 2 Next is 3 4 5 6 7 8 9 10 Next is 3 4 ACK number ACK number
Maximum Window Size Buffer Size of Receiver (rwnd: Receiver’s Window) = Maximum Window Size • Window Size = 4 segments Window Sequence Number 1 2 3 4 5 6 7 8 9 10 11 12 Sender Data Packet ACK Receiver 2 3 4 5 6 7 8 9 10 Next is ACK number
Retransmission Control (Time Out) period RTO (Retransmission Time Out) 1 2 1 Sender Packet loss Receiver Next is 2 If the ACK for a packet isn’t responded within RTO, that packet is considered loss Retransmission
Retransmission Control (duplicate ACK) If receive third duplicate ACKsRetransmission 1 2 3 4 5 6 7 8 2 9 10 11 送信側 受信側 2 2 2 2 2 2 2 9 10 11 12 Next is Three duplicate ACKs If receive three same ACKs then corresponding packet is considered loss retransmission
Experiment 3 0 4 (Bottleneck link) Bandwidth: Bw 2 3 40Mbps 40Mbps FTP/TCP 5 1 FTP Download TCP Agent TCPSink Agent Network Router Network