Download presentation
Presentation is loading. Please wait.
1
Chapter 3 Transport Layer
A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!) If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Thanks and enjoy! JFK/KWR All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking: A Top Down Approach 5th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009. Transport Layer
2
Chapter 3: Transport Layer
Our goals: understand principles behind transport layer services: multiplexing/demultiplexing reliable data transfer flow control congestion control learn about transport layer protocols in the Internet: UDP: connectionless transport TCP: connection-oriented transport TCP congestion control Transport Layer
3
Chapter 3 outline 3.1 Transport-layer services
3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment structure flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control Transport Layer
4
Transport services and protocols
application transport network data link physical provide logical communication between app processes running on different hosts transport protocols run in end systems send side: breaks app messages into segments, passes to network layer rcv side: reassembles segments into messages, passes to app layer more than one transport protocol available to apps Internet: TCP and UDP logical end-end transport application transport network data link physical Transport Layer
5
Transport vs. network layer
Household analogy (pg 200): 12 kids sending letters to 12 kids processes = kids app messages = letters in envelopes hosts = houses transport protocol = Ann and Bill who demux to in-house siblings network-layer protocol = postal service network layer: logical communication between hosts transport layer: logical communication between processes relies on, enhances, network layer services Transport Layer
6
Internet transport-layer protocols
reliable, in-order delivery (TCP) congestion control flow control connection setup connection-oriented unreliable, unordered delivery: UDP no-frills extension of “best-effort” IP connectionless services not available: delay guarantees bandwidth guarantees application transport network data link physical network data link physical network data link physical logical end-end transport network data link physical network data link physical network data link physical network data link physical application transport network data link physical Transport Layer
7
Chapter 3 outline 3.1 Transport-layer services
3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment structure flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control Transport Layer
8
Multiplexing/demultiplexing
Multiplexing at send host: Demultiplexing at rcv host: delivering received segments to correct socket gathering data from multiple sockets, enveloping data with header (later used for demultiplexing) = socket = process application application application P3 P1 P4 P1 P2 transport transport transport network network network link link link physical physical physical host 3 host 1 host 2 Transport Layer
9
How demultiplexing works
host receives IP datagrams each datagram has source IP address, destination IP address each datagram carries 1 transport-layer segment each segment has source, destination port number IP addresses & port numbers used to direct segment to appropriate socket 32 bits source port # dest port # other header fields application data (message) TCP/UDP segment format Transport Layer
10
different source ports are delivered to the same socket
Connectionless demux different source ports are delivered to the same socket Client IP:B P2 client IP: A P1 P3 server IP: C SP: 6428 DP: 9157 SP: 9157 DP: 6428 DP: 5775 SP: 5775 two-tuple: dest IP/dest port SP provides “return address” Transport Layer
11
Connection-oriented demux
TCP socket identified by 4-tuple: source IP address source port number dest IP address dest port number recv host uses all four values to direct segment to appropriate socket server host may support many simultaneous TCP sockets: each socket identified by its own 4-tuple web servers have different sockets for each connecting client non-persistent HTTP will have different socket for each request Transport Layer
12
Connection-oriented demux (cont)
different source ports are delivered to different sockets P1 client IP: A P4 P5 P6 P2 P1 P3 SP: 5775 DP: 80 S-IP: B D-IP:C SP: 9157 SP: 9157 DP: 80 DP: 80 Client IP:B server IP: C S-IP: A S-IP: B D-IP:C D-IP:C four-tuple!! Transport Layer
13
Connection-oriented demux: Threaded Web Server
P1 client IP: A P4 P2 P1 P3 SP: 5775 DP: 80 S-IP: B D-IP:C SP: 9157 SP: 9157 DP: 80 DP: 80 client IP:B server IP: C S-IP: A S-IP: B D-IP:C D-IP:C Transport Layer
14
Port Scanning w/ nmap nmap ( is a tool that scans a host to see what TCP and UDP ports it is currently listening too. You can use this to find out what network services are provided by a server. These services are also “open doors” that may be potential security holes. Transport Layer
15
Chapter 3 outline 3.1 Transport-layer services
3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment structure flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control Transport Layer
16
UDP: User Datagram Protocol [RFC 768]
“no frills,” “bare bones” Internet transport protocol “best effort” service, UDP segments may be: lost delivered out of order to app connectionless: no handshaking between UDP sender, receiver each UDP segment handled independently of others Why is there a UDP? no connection establishment (which can add delay) simple: no connection state at sender, receiver small segment header no congestion control: UDP can blast away as fast as desired Transport Layer
17
UDP: more often used for streaming multimedia apps other UDP uses
loss tolerant rate sensitive other UDP uses DNS SNMP reliable transfer over UDP: add reliability at application layer application-specific error recovery! 32 bits source port # dest port # Length, in bytes of UDP segment, including header length checksum Application data (message) UDP segment format Transport Layer
18
UDP checksum Goal: detect “errors” (e.g., flipped bits) in transmitted segment Sender: treat segment contents as sequence of 16-bit integers checksum: addition (1’s complement sum) of segment contents sender puts checksum value into UDP checksum field Receiver: compute checksum of received segment check if computed checksum equals checksum field value: NO - error detected YES - no error detected. But maybe errors nonetheless? More later …. Transport Layer
19
Calculating a 1s Complement Checksum
Note: when adding numbers, a carryout from the most significant bit needs to be added to the result 1 + wraparound + sum Kurose and Ross forgot to say anything about wrapping the carry and adding it to low order bit “flip the bits” 1s complement checksum Transport Layer
20
Internet Checksum Example
sender calculates the checksum send the original two 16-bit numbers plus the checksum to the receiver receiver calculates the sum adds the checksum + Kurose and Ross forgot to say anything about wrapping the carry and adding it to low order bit no errors! Transport Layer
21
Why does UDP Perform Error Checking?
No guarantee that link layer will do it Ethernet does UDP is end-to-end error checking, the link layer provides link-to-link error checking Bit errors may be introduced between the links, e.g., in the router’s memory, which will not be detected by the link layer NOTE: UDP does nothing to correct errors, it either drops the bad segment, or passes it to the application layer with a warning Transport Layer
22
Chapter 3 outline 3.1 Transport-layer services
3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control Transport Layer
23
Principles of Reliable data transfer
top-10 list of important networking topics! characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) Transport Layer
24
Principles of Reliable data transfer
top-10 list of important networking topics! characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) Transport Layer
25
Principles of Reliable data transfer
top-10 list of important networking topics! characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) Transport Layer
26
Reliable data transfer: getting started
rdt_send(): called from above, (e.g., by app.). Passed data to deliver to receiver upper layer deliver_data(): called by rdt to deliver data to upper send side receive side udt_send(): called by rdt, to transfer packet over unreliable channel to receiver rdt_rcv(): called when packet arrives on rcv-side of channel Transport Layer
27
Reliable data transfer: getting started
We’ll: incrementally develop sender, receiver sides of reliable data transfer protocol (rdt) consider only unidirectional data transfer but control info will flow on both directions! use finite state machines (FSM) to specify sender, receiver event causing state transition actions taken on state transition state 1 state: when in this “state” next state uniquely determined by next event state 2 event actions Transport Layer
28
Finite State Machines Finite state machines model behavior
Behavior exists as transitions from state to state Transitions are initiated by input or events Transitions are often accompanied by output or actions
29
Elevator Example
30
Pattern Recognizer
31
Even or Odd?
32
Rdt1.0: reliable transfer over a reliable channel
underlying channel perfectly reliable no bit errors no loss of packets separate FSMs for sender, receiver: sender sends data into underlying channel receiver read data from underlying channel Wait for call from above rdt_send(data) Wait for call from below rdt_rcv(packet) extract (packet,data) deliver_data(data) packet = make_pkt(data) udt_send(packet) sender receiver Transport Layer
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.