Transport ¡layer ¡and ¡TCP ¡
CSCI ¡466: ¡Networks ¡• ¡ ¡Keith ¡Vertanen ¡ ¡• ¡ ¡Fall ¡2011 ¡
Transport layer and TCP CSCI 466: Networks Keith - - PowerPoint PPT Presentation
Transport layer and TCP CSCI 466: Networks Keith Vertanen Fall 2011 Overview Principles underlying transport layer Mul9plexing/demul9plexing
CSCI ¡466: ¡Networks ¡• ¡ ¡Keith ¡Vertanen ¡ ¡• ¡ ¡Fall ¡2011 ¡
2 ¡
3 ¡
– RFC ¡793, ¡TCP ¡formally ¡defined, ¡September ¡1981 ¡ – RFC ¡1122, ¡clarifica9on ¡and ¡bug ¡fixes ¡ – RFC ¡1323, ¡high ¡performance ¡extensions ¡ – RFC ¡2018, ¡selec9ve ¡acknowledgements ¡ – RFC ¡2581, ¡conges9on ¡control ¡ – RFC ¡2873, ¡quality ¡of ¡service ¡ – RFC ¡2988, ¡improved ¡retransmission ¡9mers ¡ – RFC ¡3168, ¡conges9on ¡no9fica9on ¡ – … ¡ – RFC ¡4614, ¡guide ¡to ¡TCP ¡RFCs ¡
4 ¡
5 ¡
Four ¡512-‑byte ¡segments ¡sent ¡as ¡separate ¡IP ¡
2048 ¡bytes ¡of ¡data ¡delivery ¡ to ¡applica9on ¡in ¡single ¡ READ ¡call ¡
6 ¡ Byte 0 Byte 1 Byte 2 Byte 3 Byte 0 Byte 1 Byte 2 Byte 3
Byte 80 Byte 80
Every ¡byte ¡on ¡a ¡ TCP ¡connec9on ¡ has ¡a ¡32-‑bit ¡ sequence ¡ number ¡
7 ¡ Byte 0 Byte 1 Byte 2 Byte 3 Byte 0 Byte 1 Byte 2 Byte 3
Byte 80
TCP ¡segment ¡ TCP ¡segment ¡
Byte 80
TCP ¡segment ¡sent ¡when: ¡ 1) Segment ¡full ¡(hits ¡the ¡max ¡ segment ¡size) ¡ 2) Hits ¡a ¡9meout ¡value ¡ 3) Pushed ¡by ¡applica9on ¡
8
IP ¡Hdr ¡
TCP ¡Hdr ¡ TCP ¡Data ¡(segment) ¡
9 ¡
IP ¡Hdr ¡
TCP ¡Hdr ¡ TCP ¡Data ¡(segment) ¡
10 ¡
Next ¡in-‑order ¡ byte ¡expected ¡ Sequence ¡ number ¡of ¡first ¡ byte ¡in ¡this ¡ segment ¡ How ¡many ¡bytes ¡ may ¡be ¡sent ¡ next, ¡0 ¡= ¡no ¡more ¡ data ¡right ¡now ¡ Required ¡in ¡IPv4 ¡and ¡IPv6 ¡
11 ¡
ACK ¡ Acknowledgement ¡number ¡is ¡valid ¡(usually ¡set) ¡ PSH ¡ Pushed ¡data, ¡receiver ¡delivery ¡to ¡app ¡without ¡buffering ¡ RST ¡ Abruptly ¡reset ¡a ¡confused ¡connec9on ¡ SYN ¡ Used ¡to ¡establish ¡connec9ons ¡ FIN ¡ Used ¡to ¡release ¡a ¡connec9on ¡
12 ¡
Client ¡ Server ¡ LISTEN, ¡ACCEPT ¡ Passively ¡waits ¡for ¡incoming ¡ connec9on ¡ ¡ CONNECT ¡ Sends ¡TCP ¡segment ¡to ¡ (IP, ¡port) ¡with ¡SYN ¡bit ¡
¡ Receives ¡segment. ¡ ¡ OS ¡hands ¡off ¡to ¡process ¡that ¡ has ¡done ¡LISTEN ¡on ¡port. ¡ ¡ If ¡process ¡accepts, ¡send ¡TCP ¡ with ¡SYN ¡and ¡ACK ¡bit ¡set. ¡ ¡
Server ¡has ¡to ¡remember ¡it's ¡ sequence ¡number ¡in ¡step ¡2 ¡
Client ¡ Server ¡
requests ¡
address ¡
number ¡
13 ¡
14 ¡
15 ¡
16 ¡
hlp://www.tcpipguide.com/free/t_TCPConnec9onTermina9on-‑2.htm ¡ ¡
17 ¡
18 ¡
19 ¡
20 ¡
21 ¡
22 ¡
23 ¡
24 ¡
25 ¡
26 ¡
ACK ¡arrival ¡9mes, ¡point-‑to-‑point ¡ ACK ¡arrival ¡9mes, ¡Internet ¡
27 ¡
¡
¡
28 ¡
29 ¡
¡
¡
¡
¡
30 ¡
31 ¡
32 ¡