Beruflich Dokumente
Kultur Dokumente
A state diagram for a simple connection management scheme. Transitions labeled in italics are caused by packet arrivals. The solid lines show the client's state sequence. The dashed lines show the server's state sequence.
Berkeley Sockets
Transport Protocol
(a) Environment of the data link layer. (b) Environment of the transport layer.
Addressing
Connection Establishment
How a user process in host 1 establishes a connection with a time-of-day server in host 2.
(a) TPDUs may not enter the forbidden region. (b) The resynchronization problem.
Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. (a) Normal operation, (b) Old CONNECTION REQUEST appearing out of nowhere. (c) Duplicate CONNECTION REQUEST and duplicate ACK.
Connection Release
6-14, a, b
Four protocol scenarios for releasing a connection. (a) Normal case of a three-way handshake. (b) final ACK lost.
6-14, c,d
(c) Response lost. (d) Response lost and subsequent DRs lost.
(a) Chained fixed-size buffers. (b) Chained variable-sized buffers. (c) One large circular buffer per connection.
Dynamic buffer allocation. The arrows show the direction of transmission. An ellipsis () indicates a lost TPDU.
Multiplexing
Crash Recovery
Household analogy: 12 kids sending letters to 12 kids a)processes = kids b)app messages = letters in envelopes c)hosts = houses d)transport protocol = Ann and Bill e)network-layer protocol = postal service
a)
UDP and TCP extend IPs delivery service between two end systems to a delivery service between two processes running on the end systems
Chapter 3 outline
a)3.1 Transport-layer services b)3.2 Multiplexing and demultiplexing c)3.3 Connectionless transport: UDP d)3.4 Principles of reliable data transfer a)3.5 Connection-oriented transport: TCP
a) b) c) d) segment structure reliable data transfer flow control connection management
Multiplexing/demultiplexing
Connectionless demultiplexing
a)When host receives UDP segment: a)Create sockets with port numbers:
DatagramSocket mySocket1 = new DatagramSocket(99111); DatagramSocket mySocket2 = new DatagramSocket(99222);
a) b)
checks destination port number in segment directs UDP segment to socket with that port number
b)IP datagrams with different source IP addresses and/or source port numbers directed to same socket
Connection-oriented demux
a)TCP socket identified by 4-tuple:
a) b) c) d) source IP address source port number dest IP address dest port number
a)Socket clientSocket = new Socket(server, 6789) b)Socket conSocket =servSock.accept() c)Server host may support many simultaneous TCP sockets:
a) each socket identified by its own 4tuple
b)recv host uses all four values to direct segment to appropriate socket c)Two arriving TCP segments with different source IP addresses or source port numbers will be directed to two different sockets
Connectionless vs connection-oriented
UDP: more
a) often used for streaming multimedia apps a) loss tolerant b) rate sensitive
UDP checksum
Goal: detect errors (e.g., flipped bits) in transmitted segment
Sender:
a)treat segment contents as sequence of 16bit integers b)checksum: addition (1s complement sum) of segment contents c)sender puts checksum value into UDP checksum field
Receiver:
a)compute checksum of received segment b)check if computed checksum equals checksum field value: a) NO - error detected b) YES - no error detected. But maybe errors nonetheless? More later .
b)
1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
Introduction to UDP
c)
d) e)
(a) The position of RTP in the protocol stack. (b) Packet nesting.
a) b)
real-time multimedia applications use UDP. Internet radio, Internet telephony, music-on-demand, videoconferencing, video-on-demand, and other multimedia applications
TCP connection has two end point (sender and receiver) - sockets Sockets IP address and Port Number TCP connections are full duplex and point to point TCP connection is a byte stream not message stream TCP may send the data immediately (PUSH) or buffer it TCP urgent data (URGENT ) - receiving host is interrupted and stops what it was doing and read the urgent data
(a) Four 512-byte segments sent as separate IP datagrams. (b) The 2048 bytes of data delivered to the application in a single READ CALL.
TCP Header.
b) c)
d) e) f)
b)
The Window size(16 bits) - how many bytes may be sent starting at the byte acknowledged used in flow control
a) b)
The pseudoheader included in the TCP checksum. Checksum is also provided for extra reliability It checksums the header, the data, and the conceptual pseudoheader
6-31
(a) TCP connection establishment in the normal case. (b) Call collision.
The states used in the TCP connection management finite state machine.
(a) A fast network feeding a low capacity receiver. (b) A slow network feeding a high-capacity receiver.
(a) Probability density of ACK arrival times in the data link layer. (b) Probability density of ACK arrival times for TCP.