You are on page 1of 27

CCNA 1: An Introduction to

Networking
Week 06, Unit 07:
The Transport Layer
The Transport Layer
Learning Objectives

• Explain the purpose and functionality of the Transport layer


• Explain reliable vs. unreliable network communication
• Explain the role of TCP as it relates to the Transport layer
• Explain the role of UDP as it relates to the Transport layer
• Contrast TCP and UPD operations
• List, define, and give examples of common TCP and UDP protocols

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 2


Why the Transport Layer?

• According to Wikipedia:
“In computer networking, the transport layer or layer 4 provides end-
to-end communication services for applications within a layered
architecture of network components and protocols. The transport
layer provides convenient services such as connection-oriented
data stream support, reliability, flow control, and multiplexing.”
• In English:
Services running at the Transport layer invisibly manage a
conversation from start to finish between hosts so that the
communication occurs in a reliable manner when reliability is
needed, or, in a ‘best effort’ manner when it is not.
• Transport layer often referred to as Layer 4
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 3
Why the Transport Layer (cont’d)?

• Creates segments from data received from


Session layer
 Each segment receives header & trailer
 Segments numbered for proper ordering
 Protocols assigned port numbers
 Differentiation of simultaneous, ongoing network
communications

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 4


Why the Transport Layer (cont’d)?

• Only communicates with services directly above


and below itself in OSI model
• Session & Network layers only
• Joins upper layer services to lower layer services
• Operations based on protocol for each specific
communication
• Sending simple file data different than
sending/receiving video over network
• Long video consumes available bandwidth
• Other communications shut out

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 5


The Day in the Life of a Host

• Users perform many network communications


simultaneously
• Receive a VoIP phone message
• Many browsers open with many tabs each
– Send message to a friend via Facebook
– Viewing websites with live audio-video
– Google Drive (SaaS running)
– Gmail, etc.
• Requires management of network
communications
• Each communication called a session
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 6
Etiquette & Order

• Host must receive each packet and direct to


proper receiving service
• TCP protocols require orderly sessions:
• Proper start & end of session
• Reliable delivery and receipt of each session piece
• Reasonable order in delivery
• Management of throughput depending on bandwidth
– Called flow control

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 7


Connection-Oriented

• TCP said to be connection-oriented


• Synchronizes start of all sessions
– Each side must implement Synchronization process to begin
all sessions
– Called SYN and SYN/ACK
• Conversation pieces all numbered
• Acknowledge receipt of most session pieces
– Doesn’t add much overhead to the session
– ACK sent back to sender in most cases
• Auto resend missing session pieces
– TCP examples: HTTP, POP3, SMTP, etc.
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 8
Connectionless-Oriented

• UDP said to be connectionless


• No synchronization to start session
• Conversation pieces not numbered
• Usually no ACK for almost all session pieces
• No auto resend of missing session pieces since they
are unknown
• UDP examples: VoIP, TFTP, some DNS
operations, video
• Works because TX/RX application handles
reliability requirements
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 9
Why Orientation Matters

• Some applications require reliability


• Called connection-oriented apps
 Saving data to a database table
 Receipt of some webpage content
 Receipt of pieces of e-mail session
 Many others!
– Some applications tolerate loss of small pieces
of a session:
• Unimportant/small file or data transfers
• Live video stream
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 10
TCP - Transport Layer Header
• Some key fields:
• Source & destination ports identified
• Sequence number to reorder session pieces on
receiving end
• ACK number when segment is an ACK
• Window size is number of bytes to send at once
• Flags – used to identify segment type when needed

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 11


UDP - Transport Layer Header

• Some key fields:


• Source & destination ports identified
• No sequence number
• Usually no ACK
• No Windowing
• Checksum for both TCP & UDP is simple math to
verify data length in bits

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 12


Static & Dynamic Ports

• Port numbers identify protocol on each end of


session
• Servers usually configured with static port
numbers but can redirect to another port number
if needed
• Web server receives thousands of port 443 and port
80 requests per second and needs to differentiate
between each one using an unique port number

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 13


Ports in Use Example

• Host can choose any port number


that does not conflict with other
ports currently in use
• Port number acts like a return
address for the requesting
application
• Transport layer keeps track of this
port and the application that
initiated the request so that when a
response is returned, it can be
forwarded to the correct application

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 14


Socket To Me

• Combining a host’s IP address and port number


into one unit creates a socket
• Socket & port number not the same thing!
• Socket example:
• HTTP webpage request sent to a port 80 web server
running on a host with an IP address of 192.168.10.1
is socket 192.168.10.1:80
• Web browser requesting a web page running on host
192.168.20.1 with dynamic port number 49152
assigned to the web browser, is socket
192.168.20.1:49152
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 15
IANA & Port Numbers

• IANA assigns IP addresses, port numbers, &


other items globally
• Well-known ports (0 - 1023)
– HTTP, HTTPS, DNS, DHCP, POP3, SMTP, others
• Registered ports (1024 – 49151)
– Installed applications
• Dynamic ports (49152 – 65535)
– Assigned ‘on the fly’ as needed, short period of life
– Sometimes referred to as "Ephemeral" ports

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 16


Lean On Me

• TCP guarantees reliable communication process


• Implements 3-way handshake to create session

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 17


TCP – Getting Started

• Connection established before data can be


exchanged between hosts
• Each host tracks each segment within a session
and exchanges information about what data was
received
• Sessions are closed and the connection is
terminated when session is completed

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 18


TCP – Keeping Things Moving

• SYNs sent with specific info:


• Sequence number = 500
• Flag (control) field type = SYN
• ACKs sent with specific info:
• Sequence number = 500 + 1
• Flag (control) field type = SYN/ACK
• SYN -> SYN/ACK -> ACK
• 3-way handshake complete!
• Now ready to actually communicate

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 19


TCP – Receiving Segments

• Segments arrive in & out of order


• TCP services must reorder them when
necessary
• Segments placed in reserved RAM area called buffer
for reordering process
• Missing segments requested again

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 20


TCP – Talking Too Fast

• TCP handles flow control


• Does not send data that cannot be processed on
other end of session – slows down!
• Receiving host indicates what it can handle via
Window Size TCP header field
• Host places value in Window Size field
• If sequence number received was 900, host replies
back with 1900 if it received first 900 bytes of data
and can next handle a 1000 byte transfer
• Ongoing discussion between sender & receiver called
a sliding window (size)
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 21
TCP – Ending Things Nicely

• Settings in Flags field important:


• SYN = let’s get started if we can
• ACK = received your SYN
• RST = let’s start over again
• FIN = no more data coming from my way
– FIN is a 4-step process, similar to the 3-way handshake
• Flag fields made up of 1 bit
• Values of 0 or 1 indicate flag is on or off
• 0 = no control field entry; ignore field for now
• 1 = means control field is set & has meaning

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 22


The Odd Couple: TCP & UDP

• UDP usually implemented with no reliability,


sequencing, or flow control
• Apps that implement UDP must handle all
events to ensure a session began & completed

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 23


Examine TCP & UDP in Action

• Work with your instructor:


• Download & install latest version of Wireshark
• Begin capture process on your PC
• Open browser & log into Gmail or Facebook
• Abruptly close the browser
• Stop capture process
• Examine output in Wireshark
 Search for 3-way handshake in output
 Search for DNS to IP address resolution
 Search for 4-way TCP FIN process
 What else do you see?
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 24
Wireshark Example
• TCP ACK with Windowing example:
Length = 1460
No 1: SYN
No 2: SYN. ACK
No 3: ACK
No 4: SEQ = 1
No 5: SEQ = 566
No 6: ACK = 566 (for No. 5)
No 7: SEQ = 566 +1460 = 2026
No 8: SEQ = 2026 + 1460 = 3486
No 9: ACK = 2026 (for No. 7)
No 10: SEQ = 3486 + 1460 = 4946
No 11: SEQ = 4946 + 1460 = 6406
No 12: ACK = 3486 (for No. 8)
No 13: SEQ = 6406 + 1460 = 7866
No 14: ACK = 4946 (for No. 10)
No 15: ACK = 6406 (for No. 11)
No 16: ACK = 7866 (for No. 13)

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 25


The Transport Layer
Summary – Unit 7
• Explain the purpose and functionality of the Transport
layer
• Explain reliable vs. unreliable network communication
• Explain the role of TCP as it relates to the Transport
layer
• Explain the role of UCP as it relates to the Transport
layer
• Contrast TCP and UPD operations
• List, define, and give examples of common TCP and
UDP protocols
Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 26
The Transport Layer
References – Unit 7
References
• Odem, W. Cisco CCENT/CCNA ICND1 Academic Edition. 1st ed. Indianapolis: Cisco Press; 2013.
• Odem, W. Cisco CCENT/CCNA ICND1 100-101. 1st ed. Indianapolis: Cisco Press; 2013.
• Odem, W. Cisco CCNA ICND2 200-101. 1st ed. Indianapolis: Cisco Press; 2013.
• Dean, T. Network+ Guide to Networks. 6th ed. Boston. Course Technology; 2012.
• Transport layer. Wikipedia [free encyclopedia on the Internet]. 2013 June 23; [cited 02 July 13]; Available from:
https://en.wikipedia.org/wiki/Transport_layer.
• Transmission Control Protocol. Wikipedia [free encyclopedia on the Internet]. 2013 July 01; [cited 02 July 13];
Available from: https://en.wikipedia.org/wiki/Transmission_Control_Protocol.
• User Datagram Protocol. Wikipedia [free encyclopedia on the Internet]. 2013 July 02; [cited 02 July 13]; Available
from: https://en.wikipedia.org/wiki/User_Datagram_Protocol.
• Yale Wireshark class assignment. (ca. 2008). Yale.edu. Retrieved April 03, 2009, from:
http://zoo.cs.yale.edu/classes/cs433/assignments/assign2/TCP.pdf.

Version 1.0/Spring 2013 CCNA 1 – An Introduction to Networking 27

You might also like