Intro to Networks ch 9: Transport Layer
Transport Layer Responsibilities
Tracking Individual Conversations Segmenting Data and Reassembling Segments Identifying the Applications
What OSI layer is responsible for establishing a temporary communication session between two applications and ensuring that transmitted data can be reassembled in proper sequence?
Transport
Segmenting Data
Transport layer protocols segment the data into blocks Encapsulate each piece of data Adds headers to each piece of data
Port 80
Hypertext Transfer Protocol HTTP
UDP User Datagram Protocol
simple, unreliable
Port Number Standards
IANA
What is an advantage of UDP over TCP?
Less overhead
Well Known Ports (0-123)
Reserved for services and applications: web browsers email clients remote access clients
What is the purpose of using a source port number in a TCP communication?
To keep track of multiple conversations between devices
What is the complete range of TCP and UDP well known ports?
0-1023
TCP Connection Establishment
1. Initiating client requests a client-to-server communication session with the server 2. The server acknowledges the client-to-server communication session and requests a server-to-client communication session 3. The initiating client acknowledges the server-to-client communication sessions 1.SYN 2.SYN ACK 3.ACK
TCP operations of Reliability
1. Numbering and tracking data segments transmitted to a specific host from a specific application 2. Acknowledging received data 3. Retransmitting any unacknowledged data after a certain period in time
TCP Session Termination
1. Segment is sent with the FIN flag set 2. Server sends an ACK to acknowledge the receipt of the FIN to terminate the session from client to server 3. The server sends a FIN to the client terminate the server-to-client session 4. The client responds with an ACK to acknowledge the FIN from the server 1.FIN 2.ACK 3.FIN 4.ACK
A PC is downloading a large file from a server. The TCP window is 1000 bytes. The server is sending the file using 100-byte segments. How many segments will the server send before it requires an acknowledgment from the PC?
10 segments
Urgent
16 bits Indicates if data is urgent
Window Size
16 bits Number of bytes that can be accepted at one time
Checksum
16 bits Used for error checking of segment header and data
Source Port and Destination Port
16 bits each Used to identify the application
Acknowledgement Number
32 bits Indicates the data has been received
Sequence Number
32 bits Used for data reassembly purposes
Header Length
4 bits "data offset" Indicated length of TCP segment header
Reserved
6 bits reserved for the future
Registered Ports (1024-49151)
Assigned for use with specific processes or applications
Why does HTTP use TCP as the transport layer protocol?
Because HTTP requires reliable delivery
Which flag in the TCP header is used in response to a received FIN in order to terminate connectivity between two network devices?
ACK
Which two flags in the TCP header are used in a TCP three way handshake to establish connectivity between two network devices?
ACK SYN
OSI Transport Layer
Accept data from the application layer and prepares it for addressing at the network layer
TCP Disadvantages
Additional overhead Delays in transmissions
Unreliable delivery
Any segments lost are not resent
What type of applications are best suited for using UDP?
Applications that are sensitive to delay
Which number or set of numbers represents a socket?
Combo of an IP address and port number 192.168.1.1:80
No Ordered Data Reconstruction
Data is reconstructed in the order that it is received
What type of information is included in the transport header?
Destination and source port number
Which two characteristics are associated with UDP sessions?
Destination devices receive traffic with minimal delay Received data is unacknowledged
No Flow Control
Does not inform the sender about resource availability
Source Port Number
Dynamically generated by the sending device to identify a conversation between two devices Allows several conversations to occur
Conversation
Each set of data flowing between a source application and a destination application
Flow Control
Ensures that the receiver is able to process the data received
Same Order Delivery
Ensures that the segments are reassembled in the proper order
Establishing a session
Ensures the application is ready to receive the data
TCP Three-Way Handshake
Establishes the destination device is present on the network Verifies the destination device has an active service and is accepting requests on the destination port number the client is intending to use Informs the destination device that the source client intends to establish a communication session on that port number
TCP services
Establishing a Session Reliable Delivery Same-Order Delivery Flow Control
OSI Transport Layer Responsible for
Establishing a temporary communication session between two applications and delivering data between them Without regard to: destination host type media path taken by data congestion on the link size of the network
Applications that Use TCP
FTP SMTP TelNet HTTP
Segmentation
Facilitates data transport by the lower network layers
When to use TCP
For applications such as: web browsers e-mail clients databases Any missing data could cause a corrupt communication
Which three application layer protocols use TCP>
HTTP SMTP FTP
UDP Client Processes
Initiated by a client application that requests data from a server process Dynamically selects a port number and uses this as the source port Destination port is usually well-known or registered port number assigned to the server processes
What does a client do when it has UDP datagrams to send?
It just sends the datagrams
Stateful protocol
Keeps track of the state of a communication session Begins with the session establishment Ends with the session termination
Which three fields are used in a UDP segment header?
Length Source Port Checksum
Applications that Use UDP
Live video and multimedia applications: VoIP IPTV Simple Request and Reply Applications: DNS DHCP Applications that handle reliability themselves: SNMP TFTP
Reliable delivery
Lost segments are re-sent so the data is received complete
Conversation Multiplexing
Multiple applications can use the same network at the same time
A host device needs to send a large video file across the network while providing data communication to other users. Which feature will allow different communication streams to occur at the same time, without having a single data stream using all available bandwidth?
Multiplexing
What are three responsibilities of the transport layer?
Multiplexing multiple streams from many users or applications on the same network Meeting the reliability requirements of applications, if any Identifying the applications and services on the client and server that should handle transmitted data
Stateless Protocol
Neither the client or server is obligated to keep track of the state of the communication session Application must handle reliability
Connectionless
No session establishment
Error checking
Performed on the data segment to check if the segment was changed during transmission
Remote Authentication Dial-In User Service (RADIUS)
Provides authentication, authorization, accounting services to manage users
TCP/IP
Provides two transport layer protocols: Transmission Control Protocol User Datagram Protocol Uses these to enable hosts to communicate and transfer data
Applications that Can Use Both UDP and TCP
SNMP DNS
UDP Header
Source Port (16) Destination Port (16) Length (16) Checksum (16)
TCP segment Header
Source Port and Destination Port Sequence Number Acknowledgement Number Header Length Reserved Control bits Window Size Checksum Urgent
What is the purpose of the TCP sliding window?
To request that a source decrease the rate at which it transmits data
A client needs to terminate a TCP communication session with a server. What are the steps?
Step 1. Client sends FIN Step 2. Server sends ACK Step 3. Server sends FIN Step 4. Client sends ACK
What transport layer feature is used to guarantee session establishment?
TCP 3 way handshake
Port 20
TCP File Tranfer Protocol (data)
Port 21
TCP File Transfer Protocol (control)
Port 22
TCP Secure Shell SSH
Port 25
TCP Simple Mail Transfer Protocol SMTP
Port 23
TCP Telnet
What happens if the first packet of a TFTP transfer is lost?
The TFTP application will retry the request if a reply is not received.
What does the value of the window specify?
The amount of data that can be sent before an acknowledgement is required
Which factor determines window size?
The amount of data the destination can process at one time
Destination Port
The client places a destination port number in the segment to tell the destination server which service is being requested
Which action is performed by a client when establishing communication with a server via the use of UDP at the transport layer?
The client randomly selects a source port number
Socket
The combination of the source IP address and source port number OR The combination of the destination IP address and destination port number used to identify the server and service being requested by the client
SACK Selective Acknowledgement
The destination can acknowledge bytes in discontinuous segments and the host only needs to retransmit the missing data
A host device is receiving live streaming video. How does the device account for video data that is lost during transmission?
The device will continue receiving the streaming video, but there may be a momentary disruption.
What happens if part of an FTP message is not delivered to the destination?
The part of the FTP message that was lost is resent (FTP uses TCP)
Sliding windows
The process of the destination sending acknowledgements as it processes bytes received and the continual adjustment of the source's send window
Flags
The six bits in the Control Bits field of the TCP segment Header A bit set to on or off
Network congestion has resulted in the source learning of the loss of TCP segments that were sent to the destination. What is one way that the TCP protocol addresses this?
The source decreases the amount of data that it transmits before it receives an acknowledgement from the destination
What does TCP do if the sending source detects network congestion on the path to the destination
The source will decrease the amount of data that it sends before it must receive acknowledgements from the destination.
Initial Sequence Number ISN
The starting value of the bytes for the session that is transmitted to receiving application As data is transmitted the sequence number is incremented by the number of bytes transmitted Enables each segment to be identified and acknowledged
Identifying Applications
The transport layer assigns each application an identifier called a port number
Reassembling Segments
The transport layer reconstructs the data into a system useful to the application layer
What is a characteristic of TCP server process?
There can be many ports open simultaneously on a server, one for each active server application.
UDP Datagram Reassembly
UDP reassembles data in the order it was received and forwards it to the application The application must identify the proper sequence and determine how the data is processed
What is a characteristic of UDP?
UDP reassembles the received datagrams in the order they were received
Port 53
UDP, TCP Domain Name Service DNS
Control Bits
URG: Urgent pointer field significant ACK: Acknowledgement field significant PSH: Push function RST: Reset the connection SYN: Synchronize sequence numbers FIN: No more data from sender
UDP Features
Unreliable Delivery No Ordered Data Reconstruction Connectionless No Flow Control
Header
Used for reassembly Track the data stream
Which two services or protocols use the preferred UDP protocol for fast transmission and low overhead?
VoiP DNS
When to use UDP
When an application can tolerate some data loss during transmission but delays in the transmission are unacceptable eg: streaming live audio, live video, VoIP
When is UDP preferred to TCP?
When an application can tolerate some loss of data during transmission
Congestion Avoidance
When there is congestion, re-transmission must be controlled or it can contribute to the congestion
What kind of port must be requested from IANA in order to be used with a specific application?
a registered port
Dynamic or Private Ports (49152-65535)
aka ephemeral ports Assigned dynamically by a client's OS when a connection to a service is initiated
UDP Unreliability
best-effort no acknowledgement that the data is received
netstat
command to list protocols in use, local addresses and port numbers, foreign address and port numbers, connection state By default, will attempt to resolve IP addresses to domain names and port numbers to well known applications
netstat -n
display IP addresses and Port numbers in their numerical form
TCP Transmission Control Protocol
reliable ensures all data arrives at destination
What information is used by TCP to reassemble and reorder received segments?
sequence numbers
What is a socket?
the combination of a source IP address and port number or a destination IP address and port number
During a TCP session, a destination device sends an acknowledgment number to the source device. What does the acknowledgment number represent?
the next byte that the destination expects to receive