1 © 2007, Jae-sul Lee. All rights reserved. TCP/IP Transport and Application Layers CCNA 1 v3.11 Module 11
1© 2007, Jae-sul Lee. All rights reserved.
TCP/IP Transport and Application Layers
CCNA 1 v3.11 Module 11
22CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Agenda
11.1 TCP/IP Transport Layer
11.2 The Application Layer
• What does the TCP/IP transport layer do?• How TCP can offer connection-oriented delivery over the
connectionless IP network? • What are the TCP/IP application layers?• What do they do and how do they work?
33CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Overview• The TCP/IP transport layer
–Responsible for end-to-end data delivery• Transports data between applications on source and destination
devices• Multiplexes multiple connections between hosts
– TCP provides connection-oriented delivery• Provides reliability, orderly delivery, and flow control• Less efficient and slower due to the overhead
– UDP provides connectionless delivery• Efficient and fast, but unreliable
• The TCP/IP application layer– Relies on TCP, UDP/IP for the delivery
44CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Module objectives• Students who complete this module should be able to perform the following tasks:
– Describe the functions of the TCP/IP transport layer
– Describe flow control
– Explain how a connection is established between peer systems
– Describe windowing
– Describe acknowledgment
– Identify and describe transport layer protocols
– Describe TCP and UDP header formats
– Describe TCP and UDP port numbers
– List the major protocols of the TCP/IP application layer
– Provide a brief description of the features and operation of well-known TCP/IP applications
55CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
11.1 TCP/IP Transport Layer
11.2 The Application Layer• What does the TCP/IP transport layer do?
- Offers reliable end-to-end connectivity over the (unreliable )IP- Offers multiplexing of upper layer communications using the port numbers
• How TCP can offer connection-oriented delivery over the connectionless IP network?
- Using three way handshake, sequence number, acknowledgement, flow control by adjusting the window size
• Characteristics of TCP and UDP• How do TCP and UDP support multiple various upper layer services?
66CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Outlines11.1.1 Introduction to the TCP/IP transport layer
11.1.2 Flow control
11.1.3 Session establishment, maintenance, and termination
11.1.4 Three-way handshake
11.1.6 Acknowledgment
11.1.5 Windowing
11.1.7 TCP
11.1.8 UDP
11.1.9 TCP and UDP port numbers
77CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Introduction to the TCP/IP transport layer • The functions of the transport layer
– End-to-end logical connectivity between host applications• Transport and regulate the flow of information reliably and accurately
– Establish end-to-end operation – Divide upper layer data into segments– Send segments from one end host to another end host– Ensure data reliability and accuracy
» Error detection, request retransmission, & acknowledgments» Use sequence numbers to ensure the order of received packet
– Provide end-to-end flow control» Avoid Rx data buffer overflow at the destination» Use sliding window mechanism to control flow rate
• Matter of “Quality of Service” (QoS)
88CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
TCP and UDP port numbers • Multiplexing of upper-layer conversations
– Multiple connections can be made for multiple services• They are multiplexed into a stream of the segments in a channel
– End-to-end connections are distinguished by the port number• Each connection has unique pair of source port-destination port
– Use of port numbers are defined by IANA• The Well Known Ports: 0 ~ 1023
– Used only by system (or root) processes or by programs executed by privileged users (usually, the server processes)
• The Registered Ports: 1024 ~ 49151– Can be used by ordinary user processes or programs executed by ordinary
users (usually, the client or p2p processes)• The Dynamic and/or Private Ports: 49152 ~ 65535
99CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
TCP and UDP port numbers • Example of multiple use of ports
B=www.dtcinfo.net(203.237.160.8)
web
telnet
web
telnet
80 data1587AB
C=oslab.dtcinfo.net(203.237.160.90)
telnet
23 data1511AB
23 data1509AC
23 data1510AC
80 data1559AC
A=pearl
1010CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
TCP and UDP port numbers • Application services and port numbers
Copyrighted material is cleared
1111CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Session establishment, maintenance, and termination
• Establishing a connection-oriented session in TCP–Establishing a connection using three way handshaking
Sender requests synchronization (initiates a connecion)
Receiver acknowledges the synchronization request from the sender and requests synchronizationSender acknowledges the synchronization request from the receiver and informs the receiver that both sides agree that a connection has been established
Copyrighted material is cleared
1212CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Session establishment, maintenance, and termination
• Concept of flow control in TCP– Communicating hosts may experience congestion if
• Too fast source hosts saturate the network link• Too slow destination host fail to process the receiving packets timely• In both cases, excessive traffic overflows the buffer memory of the
nodes (routers or the destination hosts)– The packets are lost
– The TCP process has the control mechanism to avoid this problem
Copyrighted material is cleared
1313CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Session establishment, maintenance, and termination
• Overview of flow control
Copyrighted material is cleared
1414CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Session establishment, maintenance, and termination
• Termination of a connection– The source host sends a signal (FIN) that indicates the end of the
transmission – The destination host acknowledges and confirms the end of
transmission– The source host acknowledges– The connection is terminated
1515CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Three-way handshake • Establishing a connection before data transmission
– Sequence numbers are needed for reliable communication• For orderly delivery, error detection, and flow control
– Sequence numbers act as the reference of each end’s starting point
• Each host has its own sequence number – It starts with an arbitrary number at the connection establishment phase– It represents the position of the starting data octet in the segment relative
to the first octet of all data stream in a whole TCP session• Each end must know the other’s sequence number
– Two hosts must synchronize their initial sequence numbers to establish a connection
– Three-way handshake is used for this purpose1.Originating end send its own sequence number to the other end2.The other end responds with its own sequence number and the acknowledge (=
the originating end’s sequence number +1)3.The originating end responds with the acknowledge (the other’s sequence
number + 1)
1616CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Three-way handshake
= 100
SYN=1
= 101
= 300
SYN=1, ACK=1ACK=1
= 301
ACK: I have received yours.Give me next (101)
SYN: My sequence number is300ACK: I have received
yours, too. Give me next (301) Connection is established
= 101
Copyrighted material is cleared
SYN: My sequence numberis 100
1717CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Three-way handshake – example
1818CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Acknowledgment • TCP must support reliable, orderly delivery of segments
– Implemented by the sequence number and the acknowledgement• Positive acknowledgment with retransmission (PAR)
– Data stream is divided into small segments– The sender assigns sequence numbers to each segment of the data
stream1. The sender transmits a segment of sequence number N2. If the receiver received the segment, it calculates the checksum
• If the checksum is good, it sends back an ACK of sequence number N + data bytes received (positive acknowledgement)
– It means next anticipated data octet• If NOT, it discards the segment and does not send the acknowledgement
3. If the receiver did not receive the segment, it does not send the acknowledgement
4. If the sender receives ACK before the preset timer expires, it transmits a segment with sequence number (received ACK number)
• If NOT, the sender retransmits the segment of sequence number N5. The receiver reassembles the segments
1919CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Acknowledgment
You received #10.Now I send #11.I send #10.
Copyrighted material is cleared
2020CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Acknowledgment • Ex) Imagine a TCP connection is transferring a file of
6000 bytes. The sequence number for the first octet of the data is numbered 10010. What are the sequence numbers for each segment if data is sent in five segments with the first four segments carrying 1,000 bytes and the last segment carrying 2,000 bytes of data?
– The following shows the sequence number for each segment:
• Segment 1 10,010 (10,010 to 11,009)• Segment 2 11,010 (11,010 to 12,009)• Segment 3 12,010 (12,010 to 13,009)• Segment 4 13,010 (13,010 to 14,009)• Segment 5 14,010 (14,010 to 16,009)
2121CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Windowing • TCP must be able to control the amount of data flow
– Implemented by controlling the window size (sliding window)– Window size defines number of data octets that can be sent
without receiving the acknowledgement• Data octets = window size x 2 window scale factor (defined in the option field)
• The receiving end sends acknowledgement with the preferred window size
• The sending end transmits number of data octets specified by the received window size
• The sending end waits another ACK• The receiving end receives the data and replies ACK with window size
– If the buffer overflows before it receives all data octets, send reduced window size with ACK number (=received seq. number + received data octets)
– If it receives all data octets and the buffer is not filled up, send increased window size with ACK number
• The larger the window size, the faster and the more efficient the transmission is
2222CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Windowing • Comparing the transmission with window size=1 and 3
Copyrighted material is cleared
2323CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Windowing • Sliding window
Currently, window size=3Now, window size=2
Copyrighted material is cleared
2424CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
TCP • Features of TCP
– A connection-oriented transport layer protocol• Supplies a virtual circuit between end-user applications
– Provides reliable full-duplex data transmission• Breaks messages into segments• Reassembles them at the destination• Resends anything that is not received
• Upper layer application protocols supported by TCP– FTP – HTTP – SMTP – Telnet
2525CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
TCP• Header fields of a TCP segment
– Source port• Number of the port that sends data
– Destination port• Number of the port that receives data
Copyrighted material is cleared
2626CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
TCP– Sequence number
• Randomly assigned at the TCP connection establishment phase– Prevents spoofing of a hacker
• Represents the position of starting data octet in a segment relative to the first octet of all data stream in a whole TCP session
• Ensure the data arrives in the correct order
– Acknowledgement number• Represents the position of next expected TCP data octet relative to
the first octet of all data stream in a whole TCP session
– HELEN• Header length in number of 4 octets (32 bits words)
– Reserved• Set to 0
2727CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
TCP– Control field
– Window size• Number of data octets in a segment that the receiver can accept
– The receiver sets in the acknowledgement for the sender’s next transmission
– Checksum• Calculated checksum of the header and data fields
Copyrighted material is cleared
2828CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
TCP
Copyrighted material is cleared
– Urgent pointer• If the URG bit is set, this field points to the sequence number of
the last byte in a sequence of urgent data.
– Option• Includes padding
– End of option– No operation
– Data• Upper-layer protocol data
2929CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
UDP • Features of UDP
– The connectionless transport protocol in the TCP/IP protocol stack – Exchanges datagrams without guaranteed delivery
• Does not use windows or sequence numbers/ACKs• Designed for applications that do not need to put sequences of
segments together • Relies on higher-layer protocols to handle errors and retransmit data
• Upper layer application protocols supported by UDP– TFTP – SNMP – DHCP – DNS
3030CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
UDP • Header fields of a UDP segment
– Source port – Number of the port that sends data – Destination port – Number of the port that receives data – Length – Number of bytes in header and data – Checksum – Calculated checksum of the header and data fields – Data – Upper-layer protocol data
Copyrighted material is cleared
3131CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
11.1 TCP/IP Transport Layer
11.2 The Application Layer
• What are the TCP/IP application layers?• What do they do and how do they work?
3232CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Outlines11.2.1 Introduction to the TCP/IP application layer 11.2.2 DNS 11.2.3 FTP and TFTP 11.2.4 HTTP 11.2.5 SMTP 11.2.6 SNMP 11.2.7 Telnet
3333CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Introduction to the TCP/IP application layer • TCP/IP application layer
– Layers 5~7 of the OSI model are bundled into it• Handles representation, encoding, and dialog control in a layer• Provides maximum flexibility at the application layer for software
developers
Copyrighted material is cleared
3434CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
DNS • Domain naming system
– Helps easier use of the Internet• Domain names can be used instead of unfamiliar IP addresses
– It has systematic naming rules• It has the hierarchical naming structure• A FQDN (fully qualified domain name) is assigned to a host
– A hostname with its registered domain name attachedRoot domain.
org int com …pronamebizmilgovedunet tv…uskr
ac pe
dongyang
…ne
www doumi mail
co
danawa
www dica
yahoo daum naver
blog cafe www
go
gTLD ccTLD
3535CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
DNS • IP address resolution
– Translating a domain name into an IP address
– Done by the domain name servers
3636CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
DNS
3737CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
FTP and TFTP • FTP
– Used for file transfer between the systems– A reliable, connection-oriented service that uses TCP – Needs two TCP connections
• Control channel (21/TCP)• Data transfer channel (20/TCP)
3838CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
FTP and TFTP– Multiple connections and states
4
TCP connection establishedFTP session
3939CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
FTP and TFTP • TFTP
– Connectionless service that uses UDP– Designed to be small and easy to implement
• Operates faster than FTP• Works reliably in a stable environment • Used on the router to transfer configuration files and Cisco IOS images • It lacks most of the features of FTP
– Cannot list directories– No authentication features available
4040CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
HTTP • Features
– Works with the World Wide Web – Fastest growing and most used part of the Internet – Easy access to information
• Contents are represented in the form of the hypertext– Hypertext contains the multimedia contents and the hyperlinks to other
resources in the Internet• Hypertext markup language (HTML) is used to describe the location
and the format of the contents in a hypertext• The URL describes the access method and the location of the content
– scheme://[ID:password@]server[:port number][/path[/resource_filename]]
4141CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
HTTP • Client-server operation of the Web
– See next page for an example
#80
4242CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
HTTP
12
34
HTTP header
HTTP data(HTML Document)
TCP connection establishedHTTP session
End of HTTP sessionTCP connection closed
4343CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
HTTP • How the browser displays the HTML document
HTML document
Browser’s view
4444CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
HTTP• Overall transaction for a page view
http://www.dtcinfo.net/htmltest.html (request URL)ns.dtcinfo.net
dc5.donga.com
htmltest.html
http://dc5.donga.com/zero2/data/cool/IMG_8928.jpg
Internet
CLIENT
SERVERS
crw_3736_rt8.jpg
www.dtcinfo.net
4545CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
SMTP • Features
– Sends and receives the Internet mail– Transports email messages in ASCII format using TCP
• Mail flow
MUA MUA②
MTA MTA
⑤ ⑥
Mail to: [email protected]
Hi…
Hi…
SMTP#25
SMTP#25
POP3 #110IMAP4 #143
③
Mail queue
Mail box
⑦
DNS
①
④
Mail queue
⑧
⑨
daum.net naver.com
MX of naver.com?
MDA
MDA
4646CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
SMTP 1. An SMTP mail transaction
TCP connection established
SMTP session
End of SMTP sessionTCP connection closed
4747CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
SMTP 2. Filtering by the SPAM blocker
3. Received by mail.dongyang.ac.kr (see next page)
4848CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
SMTP – Retrieving a
message usingPOP3 TCP connection established
POP session
End of POP sessionTCP connection closed
4949CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
1
2
3
5050CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
SNMP • Features
– Facilitates the exchange of management information between network devices
• Network administrators can– Manage network performance– Find and solve network problems– Plan for network growth
– Uses UDP as its transport layer protocol
• Key components of the SNMP managed network – NMS monitor and control managed devices – Managed devices collect and store management information and
make this information available to NMSs using SNMP – Agents are network-management software modules that reside in
managed devices. An agent translates management information into a form compatible with SNMP
5151CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
SNMP
SNMP SNMP SNMP
Copyrighted material is cleared
5252CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Telnet • Features
– Provides the ability to login to a remote Internet host (Telnet server)– Local client acts as a remote text terminal of the Telnet server
• Local keystrokes are transmitted to the remote server• Commands are executed at the remote server• The results are displayed at the local client’s display
– Works at the application layer of the TCP/IP model • The application layer of the OSI model deals with commands• The presentation layer of the OSI model handles formatting, usually
ASCII• The session layer of the OSI model transmits
5353CCNA1 / 1st semester, 2007Network Information & Communication Program,
Dongyang Technical College
Summary• Students should understand the following main points:
– The functions of the TCP/IP transport layer– Flow control– The processes of establishing a connection between peer systems– Windowing– Acknowledgment– Transport layer protocols– TCP and UDP header formats– TCP and UDP port numbers– The processes and protocols at the TCP/IP application layer
• Domain Name Services• File Transfer Protocols• Simple Mail Transfer Protocol• Simple Network Management Protocol• Telnet