Download - 4. TCP Segment
![Page 1: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/1.jpg)
TCP Segment
TCP segment
TCP Segment
Telematics EngineeringUniversitat Politecnica de Catalunya (UPC)
1/17
![Page 2: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/2.jpg)
TCP Segment
TCP segment
Outline
1 TCP segment
2/17
![Page 3: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/3.jpg)
TCP Segment
TCP segment
TCP Segment I
• It is the PDU (Protocol Data Unit) in TCP applications.• Used in:
• Connections establishment / release.• Data transfer.• Data recognition.• Window size announcement...
3/17
![Page 4: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/4.jpg)
TCP Segment
TCP segment
TCP Segment II
4/17
![Page 5: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/5.jpg)
TCP Segment
TCP segment
Ports
TCP Socket: IPs,Ps,IPd,PdMux/Demux
5/17
![Page 6: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/6.jpg)
TCP Segment
TCP segment
Window
TCP provides an end to end Sliding-Window like flowcontrol (explained below).
6/17
![Page 7: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/7.jpg)
TCP Segment
TCP segment
Sequence Numbers I
7/17
![Page 8: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/8.jpg)
TCP Segment
TCP segment
Sequence Numbers II
• Sequence numbers of 32 bits.
• TCP transmits the byte stream splited into segments.
• Each byte of the flow is identified by a unique sequencenumber.
• This number is reused cyclically (wrap around).
• Sequence numbers refer to bytes in ”flight“.
8/17
![Page 9: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/9.jpg)
TCP Segment
TCP segment
Sequence Numbers III
• The sequence number of the first flow’s byte israndomly chosen at the start of the connection (InitialSequence Number).
• In the following segments, reveals the first packed byteinto the byte stream.
• In ACKs indicates the next byte that is expected to bereceived.
• TCP generates a RESET when an impossiblesequence number is received.
9/17
![Page 10: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/10.jpg)
TCP Segment
TCP segment
Other Fields I
10/17
![Page 11: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/11.jpg)
TCP Segment
TCP segment
Other Fields II
• Header Length in 32 bits word.• The header size is variable as it may contain options.
• Code Bits (6 bits):• SYN: Synchronism. Indicates the start of the
connection.• FIN: Reveals the end of the connection.• RST: Reset of the connection.• PSH: Force the delivery of information.• ACK: Valid recognition field.• URG: Valid urgent pointer field.
• Urgent Data Pointer: position where urgent data ends.
11/17
![Page 12: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/12.jpg)
TCP Segment
TCP segment
Urgent Mode
• It provides a way to send ”offtopic“ data.• Another parallel flow (the flow ”urgent“).• To do so:
• An end can mark the data as urgent.• TCP must notify to the receiver process, and the
application must make sense of it.
12/17
![Page 13: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/13.jpg)
TCP Segment
TCP segment
Checksum I
13/17
![Page 14: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/14.jpg)
TCP Segment
TCP segment
Checksum II
• UDP like.• However, in this case, the checksum is mandatory.• Check the integrity of TCP data, header and
pseudo-header taking keeping in mind:
• Protection against faulty segments due to routingerrors.
14/17
![Page 15: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/15.jpg)
TCP Segment
TCP segment
Options
15/17
![Page 16: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/16.jpg)
TCP Segment
TCP segment
MSS Option
• MSS (Maximum Segment Size)• Aims to inform the other end of the maximum Bytes a
TCP segment can contain.• This option can be sent within the SYN segment. Why
MSS? Efficiency!• Small Packets:
• Inefficiency.• Large Packages:
• Fragmentation.• The loss of fragment implies the retransmission of the
entire segment.
16/17
![Page 17: 4. TCP Segment](https://reader031.vdocuments.us/reader031/viewer/2022020311/577cbd691a28aba7118de65a/html5/thumbnails/17.jpg)
TCP Segment
TCP segment
Timestamp Option
• Allows the transmitter to include time reference in eachsegment.
• The receiver echoes the timestamp.• By this option, the sender can estimate the segment
round trip time (RTT).• Very useful in precise timeout estimation.
17/17