End-‑to-‑End ¡Protocols ¡
Guevara ¡Noubir ¡
Fundamentals of Computer Networks End-to-End Protocols
Textbook: Computer Networks: A Systems Approach,
- L. Peterson, B. Davie, Morgan Kaufmann
Chapter 5.
1
End-to-End Protocols Guevara Noubir Textbook: Computer - - PowerPoint PPT Presentation
End-to-End Protocols Guevara Noubir Textbook: Computer Networks: A Systems Approach, L. Peterson, B. Davie, Morgan Kaufmann Chapter 5. Fundamentals of Computer Networks End-to-End Protocols 1 Lecture Outline
Fundamentals of Computer Networks End-to-End Protocols
1
– Connec8on ¡ – Establishment/Termina8on ¡ – Sliding ¡Window ¡Revisited ¡ ¡ – Flow ¡Control ¡ – Adap8ve ¡Timeout ¡ – Overview ¡of ¡Remote ¡Procedure ¡Call ¡ ¡
Fundamentals of Computer Networks End-to-End Protocols 2
communica8on ¡channel ¡
– drop ¡messages ¡ – re-‑orders ¡messages ¡ – delivers ¡duplicate ¡copies ¡of ¡a ¡given ¡message ¡ – limits ¡messages ¡to ¡some ¡finite ¡size ¡ – delivers ¡messages ¡aMer ¡an ¡arbitrarily ¡long ¡delay ¡
– guarantee ¡message ¡delivery ¡ – deliver ¡messages ¡in ¡the ¡same ¡order ¡they ¡are ¡sent ¡ – deliver ¡at ¡most ¡one ¡copy ¡of ¡each ¡message ¡ – support ¡arbitrarily ¡large ¡messages ¡ – support ¡synchroniza8on ¡ – allow ¡the ¡receiver ¡to ¡flow ¡control ¡the ¡sender ¡ – support ¡mul8ple ¡applica8on ¡processes ¡on ¡each ¡host ¡
Fundamentals of Computer Networks End-to-End Protocols 3
Fundamentals of Computer Networks End-to-End Protocols 4
– servers ¡have ¡well-‑known ¡ports ¡(e.g., ¡DNS: ¡port ¡53, ¡talk: ¡517) ¡ – On ¡Unix ¡see ¡/etc/services ¡and ¡port ¡mapper ¡
– pseudo ¡header ¡+ ¡UDP ¡header ¡+ ¡data ¡ – Pseudo ¡header ¡= ¡protocol ¡number, ¡source ¡IP ¡addr, ¡dest ¡IP ¡addr, ¡ UDP ¡length ¡
Fundamentals of Computer Networks End-to-End Protocols SrcPort DstPort Checksum Length Data 16 31 5
– app ¡writes ¡bytes ¡ – TCP ¡sends ¡segments ¡ – app ¡reads ¡bytes ¡
Fundamentals of Computer Networks End-to-End Protocols Application process W rite bytes TCP Send buffer Segment Segment Segment T ransmit segments Application process Read bytes TCP Receive buffer … … …
6
– need ¡explicit ¡connec8on ¡establishment ¡and ¡termina8on ¡
– need ¡adap8ve ¡8meout ¡mechanism ¡
– need ¡to ¡be ¡prepared ¡for ¡arrival ¡of ¡very ¡old ¡packets ¡
– need ¡to ¡accommodate ¡different ¡node ¡capacity ¡
– need ¡to ¡be ¡prepared ¡for ¡network ¡conges8on ¡
Fundamentals of Computer Networks End-to-End Protocols 7
Fundamentals of Computer Networks End-to-End Protocols 8
Fundamentals of Computer Networks End-to-End Protocols 9
– (SrcPort, SrcIPAddr, DsrPort, DstIPAddr) ¡
– acknowledgment, SequenceNum, AdvertisedWindow
– SYN, FIN, RESET, PUSH, URG, ACK ¡
– pseudo ¡header ¡+ ¡TCP ¡header ¡+ ¡data ¡
Fundamentals of Computer Networks End-to-End Protocols
Sender Data (SequenceNum) Acknowledgment + AdvertisedWindow Receiver
10
Fundamentals of Computer Networks End-to-End Protocols 11
Fundamentals of Computer Networks End-to-End Protocols
Active participant (client) Passive participant (server) SYN, SequenceNum = x
SYN + ACK, SequenceNum =
y
,
A C K , A c k n
l e d g m e n t = y + 1 Acknowledgment = x + 1
12
Fundamentals of Computer Networks End-to-End Protocols CLOSED LISTEN SYN_RCVD SYN_SENT ESTABLISHED CLOSE_WAIT LAST_ACK CLOSING TIME_WAIT FIN_WAIT_2 FIN_WAIT_1 Passive open Close Send/ SYN SYN/SYN + ACK SYN + ACK/ACK SYN/SYN + ACK ACK Close /FIN FIN/ACK Close /FIN FIN/ACK Timeout after two segment lifetimes FIN/ACK ACK ACK ACK Close /FIN Close CLOSED Active open /SYN 13
Fundamentals of Computer Networks End-to-End Protocols 14
– LastByteAcked < ¡= LastByteSent ¡ – LastByteSent < ¡= LastByteWritten ¡ – buffer ¡bytes ¡between ¡ LastByteAcked ¡and ¡ LastByteWritten ¡
Fundamentals of Computer Networks End-to-End Protocols Sending application LastByteWritten TCP LastByteSent LastByteAcked Receiving application LastByteRead TCP LastByteRcvd NextByteExpected
– LastByteRead < NextByteExpected – NextByteExpected < = LastByteRcvd +1 – buffer bytes between LastByteRead and LastByteRcvd
15
– LastByteRcvd ¡-‑ ¡LastByteRead ¡< ¡= ¡MaxRcvBuffer ¡ – AdvertisedWindow ¡= ¡MaxRcvBuffer ¡-‑ ¡(LastByteRcvd ¡-‑ ¡ LastByteRead ¡) ¡
– LastByteSent ¡-‑ ¡LastByteAcked ¡< ¡= ¡AdvertisedWindow ¡ – EffectiveWindow ¡= ¡AdvertisedWindow ¡-‑ ¡(LastByteSent ¡-‑ ¡ ¡ ¡ ¡ ¡ LastByteAcked) ¡ – LastByteWritten ¡-‑ ¡LastByteAcked ¡< ¡= ¡MaxSendBuffer ¡ – block ¡sender ¡if ¡(LastByteWritten ¡-‑ ¡LastByteAcked) ¡+ ¡y ¡> ¡ MaxSenderBuffer ¡
Fundamentals of Computer Networks End-to-End Protocols 16
¡ ¡Bandwidth ¡ ¡ ¡ ¡Time ¡Un8l ¡Wrap ¡Around ¡ ¡ ¡T1 ¡(1.5 ¡Mbps) ¡ ¡ ¡6.4 ¡hours ¡ ¡ ¡Ethernet ¡(10 ¡Mbps) ¡ ¡57 ¡minutes ¡ ¡ ¡T3 ¡(45 ¡Mbps) ¡ ¡ ¡ ¡13 ¡minutes ¡ ¡ ¡FDDI ¡(100 ¡Mbps) ¡ ¡ ¡6 ¡minutes ¡ ¡ ¡STS-‑3 ¡(155 ¡Mbps) ¡ ¡ ¡4 ¡minutes ¡ ¡ ¡STS-‑12 ¡(622 ¡Mbps) ¡ ¡55 ¡seconds ¡ ¡ ¡STS-‑24 ¡(1.2 ¡Gbps) ¡ ¡ ¡28 ¡seconds ¡
Fundamentals of Computer Networks End-to-End Protocols 17
– (assuming an RTT ~100ms) ¡ ¡Bandwidth ¡ ¡ ¡ ¡Delay ¡x ¡Bandwidth ¡Product ¡ ¡ ¡T1 ¡(1.5 ¡Mbps) ¡ ¡ ¡18KB ¡ ¡ ¡Ethernet ¡(10 ¡Mbps) ¡ ¡122KB ¡ ¡ ¡T3 ¡(45 ¡Mbps) ¡ ¡ ¡ ¡549KB ¡ ¡ ¡FDDI ¡(100 ¡Mbps) ¡ ¡ ¡1.2MB ¡ ¡ ¡STS-‑3 ¡(155 ¡Mbps) ¡ ¡ ¡1.8MB ¡ ¡ ¡STS-‑12 ¡(622 ¡Mbps) ¡ ¡7.4MB ¡ ¡ ¡STS-‑24 ¡(1.2 ¡Gbps)
Fundamentals of Computer Networks End-to-End Protocols 18
Fundamentals of Computer Networks End-to-End Protocols 19
Fundamentals of Computer Networks End-to-End Protocols 20
Fundamentals of Computer Networks End-to-End Protocols 21
Fundamentals of Computer Networks End-to-End Protocols
Sender Receiver O r i g i n a l t r a n s m i s s i
A C K SampleR TT R e t r a n s m i s s i
Sender Receiver O r i g i n a l t r a n s m i s s i
A C K SampleR TT R e t r a n s m i s s i
22
– where ¡δ ¡is ¡a ¡factor ¡between ¡0 ¡and ¡1 ¡
– where ¡typically ¡µ ¡= ¡1 ¡and ¡φ ¡= ¡4 ¡
– algorithm ¡only ¡as ¡good ¡as ¡granularity ¡of ¡clock ¡(500ms ¡on ¡old ¡Unix) ¡ – accurate ¡8meout ¡mechanism ¡important ¡to ¡conges8on ¡control ¡(later) ¡
Fundamentals of Computer Networks End-to-End Protocols 23
Fundamentals of Computer Networks End-to-End Protocols 24
Fundamentals of Computer Networks End-to-End Protocols 25
– BLAST: ¡fragments ¡and ¡reassembles ¡large ¡messages ¡ – CHAN: ¡synchronizes ¡request ¡and ¡reply ¡messages ¡ ¡ – SELECT: ¡dispatches ¡request ¡to ¡the ¡correct ¡process ¡
Fundamentals of Computer Networks End-to-End Protocols
Caller (client) Client stub RPC protocol Return value Arguments Reply Request Callee (server) Server stub RPC protocol Return value Arguments Reply Request
26
Fundamentals of Computer Networks End-to-End Protocols 27
– Mul8media ¡date ¡exchange ¡
– Periodic ¡control ¡informa8on ¡e.g., ¡sta8s8cs ¡on ¡packets ¡loss, ¡inter-‑ arrival ¡jimer, ¡sender ¡iden8ty ¡
– ¡through ¡profiles, ¡and ¡formats, ¡ ¡ – compact ¡header ¡format ¡(ver., ¡padding, ¡extension, ¡# ¡contribu8ng ¡ sources, ¡payload ¡type ¡(e.g., ¡codecs), ¡sequence ¡number, ¡ 8mestamp, ¡synchroniza8on ¡source ¡(SSRC), ¡contribu8ng ¡source ¡ (CSRC) ¡
Fundamentals of Computer Networks End-to-End Protocols 28
Fundamentals of Computer Networks End-to-End Protocols
Sender Receiver F r a g m e n t 1 F r a g m e n t 2 F r a g m e n t 3 F r a g m e n t 5 F r a g m e n t 4 F r a g m e n t 6 F r a g m e n t 3 F r a g m e n t 5 SRR SRR
29
Fundamentals of Computer Networks End-to-End Protocols 30
– send ¡SRR ¡and ¡set ¡8mer ¡RETRY ¡
– send ¡SRR ¡and ¡set ¡8mer ¡RETRY ¡
– send ¡SRR ¡and ¡set ¡8mer ¡RETRY ¡
– give ¡up ¡and ¡free ¡par8al ¡message ¡
Fundamentals of Computer Networks End-to-End Protocols 31
– if ¡Type=DATA, ¡iden8fies ¡this ¡fragment ¡ – if ¡Type=SRR, ¡iden8fies ¡missing ¡fragments ¡ ¡
Fundamentals of Computer Networks End-to-End Protocols 32
Fundamentals of Computer Networks End-to-End Protocols
Client Server Request ACK R e p l y A C K
Client Server Request 1 Request 2 R e p l y 2 R e p l y 1
33
– set ¡RETRANSMIT ¡8mer ¡ – use ¡message ¡id ¡(MID) ¡field ¡to ¡dis8nguish ¡ ¡
– client ¡periodically ¡sends ¡“are ¡you ¡alive” ¡probe, ¡or ¡ ¡ – server ¡periodically ¡sends ¡“I’m ¡alive” ¡no8ce ¡ ¡
– use ¡channel ¡id ¡(CID) ¡field ¡to ¡dis8nguish ¡ ¡
– use ¡boot ¡id ¡(BID) ¡field ¡to ¡dis8nguish ¡ ¡
Fundamentals of Computer Networks End-to-End Protocols 34
xPush(Sessn s, Msg *msg)
xPop(Sessn s, Msg *msg, void *hdr) xDemux(Protl hlp, Sessn s, Msg *msg)
xCall(Sessn s, Msg *req, Msg *rep)
xCallPop(Sessn s, Msg *req, Msg *rep, void *hdr) xCallDemux(Protl hlp, Sessn s, Msg *req, Msg *rep)
Fundamentals of Computer Networks End-to-End Protocols 35
Fundamentals of Computer Networks End-to-End Protocols
Caller SELECT CHAN xCall xCall xDemux xPush Callee SELECT CHAN xCallDemux xCallDemux xDemux xPush Server Client
36
Fundamentals of Computer Networks End-to-End Protocols
BLAST ETH IP SELECT CHAN
37
– except ¡no ¡selec8ve ¡retransmit ¡
– except ¡not ¡at-‑most-‑once ¡
– UDP ¡dispatches ¡to ¡program ¡(ports ¡bound ¡to ¡programs) ¡ – SunRPC ¡dispatches ¡to ¡procedure ¡within ¡program ¡ ¡
Fundamentals of Computer Networks End-to-End Protocols 38
Fundamentals of Computer Networks End-to-End Protocols Data MsgType = CALL XID RPCVersion = 2 Program Version Procedure Credentials (variable) Verifier (variable) 31 Data MsgType = REPLY XID Status = ACCEPTED 31 39
– integers ¡ – floats ¡ – strings ¡ – arrays ¡ – structs ¡
Fundamentals of Computer Networks End-to-End Protocols
Application data Presentation encoding Application data Presentation decoding Message Message Message …
– images – video – multimedia documents
40
– floa8ng ¡point: ¡IEEE ¡754 ¡versus ¡non-‑standard ¡ ¡ – integer: ¡big-‑endian ¡versus ¡limle-‑endian ¡(e.g., ¡34,677,374) ¡
Fundamentals of Computer Networks End-to-End Protocols
(126) (34) (17) (2) 00000010 Big- endian Little- endian (2) (17) (34) (126) High address Low address 1 1 1 1 1 1 1 0 0 1 1 0 1 1 0 0 1 1 0 1 0 0 0 0 1 1 1 1 1 1 1
41
– base ¡types ¡(e.g., ¡ints, ¡floats); ¡must ¡convert ¡ – flat ¡types ¡(e.g., ¡structures, ¡arrays); ¡must ¡pack ¡ – complex ¡types ¡(e.g., ¡pointers); ¡must ¡linearize ¡
– canonical ¡intermediate ¡form ¡ – receiver-‑makes-‑right ¡(an ¡N ¡x ¡N ¡solu8on) ¡ ¡
Fundamentals of Computer Networks End-to-End Protocols
Marshaller Application data structure
42
Fundamentals of Computer Networks End-to-End Protocols
type = INT len = 4 value = 417892
Call P Client stub RPC Arguments Marshalled arguments Interface descriptor for Procedure P Stub compiler Message Specification P Server stub RPC Arguments Marshalled arguments Code Code
43
Fundamentals of Computer Networks End-to-End Protocols 44
#define MAXNAME 256; #define MAXLIST 100; struct item { int count; char name[MAXNAME]; int list[MAXLIST]; }; bool_t xdr_item(XDR *xdrs, struct item *ptr) { return(xdr_int(xdrs, &ptr->count) && xdr_string(xdrs, &ptr->name, MAXNAME) && xdr_array(xdrs, &ptr->list, &ptr->count, MAXLIST, sizeof(int), xdr_int)); }
Fundamentals of Computer Networks End-to-End Protocols
Count Name J O 3 7 H N S O N List 3 4 9 7 2 6 5 8 3 2 1
45
Fundamentals of Computer Networks End-to-End Protocols
value type type length value length type value length
46
Fundamentals of Computer Networks End-to-End Protocols
47