Professional Documents
Culture Documents
Peer-to-Peer Protocols
Peer-to-Peer Protocols and Service Models Flow Control ARQ Protocols Data Link Control
Peer-to-Peer protocols: many protocols involve the interaction between two peers
Service Models Detailed discussion of ARQ provides example of development of peer-to-peer protocols Data Link Control Framing PPP HDLC
Peer-to-Peer Protocols
n + 1 peer process
n + 1 peer process
SDU
n peer process
SDU PDU
n peer process
Peer-to-Peer processes execute layer-n protocol to provide service to layer-(n+1) Layer-(n+1) peer calls layer-n and passes Service Data Units (SDUs) for transfer Layer-n peers exchange Protocol Data Units (PDUs) to effect transfer Layer-n delivers SDUs to destination layer-(n+1) peer
n 1 peer process
n 1 peer process
Service Models
The service model specifies the information transfer service layer-n provides to layer-(n+1) The most important distinction is whether the service is:
Connection-oriented Connectionless
Message Size and Structure What message size and structure will a service model accept?
Different services impose restrictions on size & structure of data it will transfer Single bit? Block of bytes? Byte stream? Ex: Transfer of voice mail = 1 long message Ex: Transfer of voice call = byte stream
1 voice mail= 1 message = entire sequence of speech samples (a) 1 call = sequence of 1-byte messages (b)
2 or more blocks
1 block
Flow Control
Messages can be lost if receiving system does not have sufficient buffering to store arriving messages If destination layer-(n+1) does not retrieve its information fast enough, destination layer-n buffers may overflow Flow Control provide backpressure mechanisms that control transfer according to availability of buffers at the destination Examples: TCP and HDLC
Timing
Applications involving voice and video generate units of information that are related temporally Destination application must reconstruct temporal relation in voice/video units Network transfer introduces delay & jitter Timing Recovery protocols use timestamps & sequence numbering to control the delay & jitter in delivered information Examples: RTP & associated protocols in Voice over IP
Multiplexing Multiplexing enables multiple layer-(n+1) users to share a layer-n service A multiplexing tag is required to identify specific users at the destination Examples: UDP, IP
Faster recovery Simple inside the network More scalable if complexity at the edge
End-to-end
ACK/NAK
1 Data
2 Data
3 Data
4 Data
10/06/11
14
10/06/11
15
10/06/11
16
Sliding Window
Sliding Window Protocols are a feature of packet-based data transmission protocols. They are used where reliable in-order delivery of packets is required, such as in the data link layer (OSI model) as well as in TCP (transport layer of the OSI model). Conceptually, each portion of the transmission (packets in most data link layers, but bytes in TCP) is assigned a unique consecutive sequence number, and the receiver uses the numbers to place received packets in the correct order, discarding duplicate packets and identifying missing ones. The problem with this is that there is no limit of the size of the sequence numbers that can be required.
10/06/11
17
10/06/11
18
10/06/11
19
10/06/11
20
Sender
Receiver
10/06/11
22
Error-detecting code with high error coverage ACKs (positive acknowledgments) NAKs (negative acknowlegments) Timeout mechanism
Computer Networks and Protocols 23
ERROR CONTROL
10/06/11
24
Stop-and-Wait ARQ
Transmitter Ready state
Await request from higher layer for packet transfer When request arrives, transmit frame with updated S and CRC Go to Wait State Wait for ACK or timer to expire; block requests from higher layer If timeout expires
retransmit frame and reset timer
Wait state
If ACK received:
If sequence number is incorrect or if errors detected: ignore ACK If sequence number is EQUAL accept frame, go to Ready state
If errors detected
discard frame
10/06/11
25
10/06/11
26
Stop-and-Wait ARQ
Transmit a frame, wait for ACK
Packet
Information frame
CRC Header
Computer Networks and Protocols
CRC
27
Information frame
Damaged Frame
10/06/11
28
10/06/11
29
10/06/11
30
Go-Back-N
Improve Stop-and-Wait by not waiting! Keep channel busy by continuing to send frames Allow a window of up to Ws outstanding frames Use m-bit sequence numbering If ACK for oldest frame arrives before window is exhausted, we can continue transmitting If window is exhausted, pull back and retransmit all outstanding frames Alternative: Use timeout
10/06/11 Computer Networks and Protocols 31
Go-Back-N ARQ
Go-Back-4: A
fr 0 fr 1 fr 2 fr 3 fr 4 fr 5
Time
B
A C K 1 A C K 2 A C K 3 out of sequence frames A C K 4 A C K 5 A C K 6 A C K 7 A C K 8 A C K 9
Rnext 0
Frame transmission are pipelined to keep the channel busy Frame with errors and subsequent out-of-sequence frames are ignored Transmitter is forced to go back when window of 4 is exhausted
Computer Networks and Protocols 32
10/06/11
Damaged Frame
10/06/11
33
Lost Frame
10/06/11
34
Lost ACK
10/06/11
35
10/06/11
36
Selective Reject
10/06/11
38
10/06/11
39
10/06/11
40
10/06/11
41
PPP provides router-to-router and host-tonetwork connections over synchronous and asynchronous circuits, which can be either dialup or leased lines. PPP is the protocol of choice when configuring serial links in a multivendor environment.
10/06/11
42
PPP actually uses HDLC as a basis for encapsulating datagrams. PPP's frame format is based on the HDLC frame format. PPP defines the Link Control Protocol (LCP). The job of LCP is to establish, configure, and test the data-link connection.
10/06/11
43
Point-to-Point Link
10/06/11
44
Transition States
10/06/11
45
PPP Layers
10/06/11
46
PPP Frames
10/06/11
47
10/06/11
48
PAP
Password Authentication Protocolprovides a simple method for the peer to establish its identity using a 2-way handshake. This is done only upon initial link establishment. After the Link Establishment phase is complete, an Id/Password pair is repeatedly sent by the peer to the authenticator until authentication is acknowledged or the connection is terminated
10/06/11 Computer Networks and Protocols 49
PAP Packets
10/06/11
50
10/06/11
52
HDLC Basis
Why do we use it ?
Framing Frame Protection Error Recovery
Three Modes
Normal Response Mode[NRM] Asynchronous Response Mode[ARM] Asynchronous Balance Mode[ABM]
10/06/11 Computer Networks and Protocols 53
HDLC Configuration
10/06/11
54
HDLC Configuration
10/06/11
55
HDLC Configuration
10/06/11
56
HDLC Modes
10/06/11
57
10/06/11
58
10/06/11
59
10/06/11
60
10/06/11
61
Bit Stuffing
10/06/11
62
10/06/11
63
10/06/11
64
Poll/Final
10/06/11
65
10/06/11
66
10/06/11
67
Peer-to-Peer Example
10/06/11
68
Peer-to-Peer Example
10/06/11
69