Title: Network and Transport Layers
1Network and Transport Layers
- After studying this Chapter you should
- Become familiar with
- packetizing and linking to the application layer
- four standard transport/network protocols
- network addressing
- different types of routing
- Understand how TCP/IP works
2Introduction
- Transport Network Layer Protocols
- TCP/IP, IPX/SPX, X.25, SNA
- Transport Layer Functions
- Interacting with Application Layer
- Packetizing
- End-to-en delivery of application layer messages
- Network Layer Functions
- Addressing
- Routing
3Introduction
- Transport and Network layers
- Responsible for moving
messages from end-to-end
in a network - Closely tied together
- TCP/IP most commonly used
protocol - Used in Internet
- Compatible with a variety of Application Layer
protocols as well as with many Data Link Layer
protocols
Application Layer
Transport Layer
Network Layer
Data Link Layer
4Introduction - Transport layer
Application Layer
- Responsible for end-to-end delivery
- of messages
- Sets up virtual circuits (when needed)
- Responsible for segmentation and
- reassembly
- Breaking the message into several smaller pieces
at the sending end - Reconstructing the original message into a single
whole at the receiving end - Interacts with Application Layer
Transport Layer
Network Layer
5Introduction Network Layer
- Responsible for addressing and routing
- of messages
- Selects the best path from computer to
- computer until the message reaches
destination - Performs encapsulation on sending end
- Adds network layer header to message segments and
passes the message on to the Data Link Layer - Performs decapsulation on receiving end
- Removes the network layer header at receiving end
and passes them up to the transport layer - Both the sender and receiver have to agree on the
rules or protocols that govern how their network
layers will communicate with each other.
Transport Layer
Network Layer
Data Link Layer
6Transport/Network Layer Protocols
- there are many transport and network protocols
- they all perform the same or similar functions
- they are incompatible with each other
- vendors now provide software with multiprotocol
stacks
7Protocols
- The four most commonly used protocols are
- TCP/IP
- IPX/SPX
- X.25
- SNA
8TCP/IP
- Transmission Control Protocol / Internet Protocol
- The oldest networking standard (DoD, 1974)
- The most popular protocol suite (70)
- TCP/IP allows reasonable efficient and error-free
transmission. - Is a combination of two protocols
- TCP - Transmission Control Protocol
- IP - Internet Protocol
9Transmission Control Protocol
- TCP performs the packetizing function
- breaking data into smaller packets
- numbering packets
- ensuring reliable delivery of packets
- ordering packets at the destination
10Internet Protocol
- IP performs network routing and addressing
functions - IPv4 - 32-bit address - 192-bit header (24
bytes) - IPv6 - 128-bit address - 320-bit header (40
bytes) - Both versions have a variable length data field
- Max size depends on the data link layer protocol.
- e.g., Ethernets max message size is 1,492 bytes,
so max size of TCP message field - 1492 24 24 1444 bytes
TCP header
IPv4 header
11TCP Packet
1 Source port number 16 bits 2 Destination port
number 16 bits 3 Sequence number 32
bits 4 ACK number 32 bits 5 Header length 4
bits 6 Unused 6 bits 7 Flags 6
bits 8 Flow control 16 bits 9 CRC 16 16
bits 10 Urgent pointer 16 bits 11 Options
16 bits
12IP Packet version
IP4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
1 Version number 4 bits 2 Header length 4
bits 3 Type of Service 8 bits 4 Total length 16
bits 5 Identifiers 16 bits 6 Flags 3
bits 7 Packet offset 13 bits 8 Hop limit 8 bits
9 Protocol 8 bits 10 CRC 16 16 bits 11 Source
address 32 bits 12 Destination Address 32
bits 13 Options varies 14 User
data varies 15 Priority 4 bits 16 Flow name 8
bits 17 Next header
IP6
1
15
16
4
17
14
11 (128 bits)
8
12 (128 bits)
13IPX/SPX
- Internetwork Packet Exchange / Sequenced Packet
Exchange - Based on a routing protocol developed by XeroX
(mid 70s) - Primary network protocol used by Novell up until
they released version 5 of Netware
14IPX/SPX
- Is a combination of two protocols
- SPX - Sequenced Packet Exchange
- breaking the data into smaller packets
- numbering them
- ensuring each packet is reliably delivered
- putting them in proper order at the destination
- IPX - Internetwork Packet Exchange
- routing
- addressing
- Similar to TCP/IP
15IPX Packet
User Data
1 Checksum 2 bytes 2 Length 2 byte 3
Control 1 byte 4 Type 1 byte 5
Destination address 6 bytes 6 Destination
network address 4 bytes 7 Destination socket 2
bytes 8 Source address 6 bytes 9 Source
network address 4 bytes 10 Source socket 2 bytes
IPX packet
16SPX Packet
User Data
SPX packet
1 Control 1 byte 2 Type 1 byte 3 Source
ID 2 bytes 4 Destination ID 2 bytes 5
Sequence number 2 bytes 6 ACK number 2 bytes 7
Allocation number 2 bytes
17X.25
- Developed by ITU-T for use in WANs
- Mature, global standard used by many
international organizations - Seldom used in North America except by
organizations with WANs having non-North American
connections
18X.25
- Is a combination of two protocols
- X.3 - responsible for packetizing
- PLP - Packet Layer Protocol
- routing
- addressing
- 128 bytes of data recommended but up to 1024
bytes supported - PLP is usually combined with Data Link Protocol
LAP-B
19SNA
- Systems Network Architecture
- Developed by IBM in 1974, IBM proprietary
non-industry standard protocol - Transmission Control layer performs packetizing
- Path Control layer performs routing and
addressing - Requires special equipment to translate between
LANs and mainframes - Uses SDLC as its data link layer protocol
- Likely to disappear over time
- IBM now offers TCP/IP on its networks
20SNA - 7 Layer Model
Application Layer
Presentation Layer
Data Flow Layer
Transmission Control
Path Control
Data Link Control
Physical Layer
21Transport Layer Functions
- Linking to the Application layer
- Packetizing and Reassembly
- Establishing connections (virtual)
- Connection-Oriented routing
- Connectionless routing
- Quality of Service (QoS)
22Linking to the Application Layer
- TCP may serve several Application Layer protocols
at the same time - Problem Which application layer program to send
a message to? - Solution Port numbers located in TCP header
fields 2-byte each (source, destination) - Each type of application has a unique port
address - Standard port address
- port 80 - Web server
- port 21 - FTP
- port 23 - Telnet
- port 25 - SMTP
23Application Layer Services
Figure 5.5
24Packetization Reassembly
- breaking large data messages into smaller packets
for transmission through the network - size is dependent of data link layer protocol
- default size without protocol is 536 bits
- size can be negotiated between sender and
receiver - numbering packets (sequencing) when needed
- ensuring reliable delivery of every packet
- delivered one at a time or held until all have
arrived at the destination - reassembling and ordering packets at the
destination
25Connection-Oriented Routing
- Sets up a virtual circuit between sender and
receiver - Network layer decides which route the packets
will be travelling - transport layer sends a special packet called a
SYN - Network layer sends the packets sequentially (all
packets travel the same path, from source to
destination) - packet deliveries are acknowledged
- used by HTTP, SMTP, FTP
- Virtual circuit appears to the application
software to use point-to-point circuit-switching - actually uses store and forward switching
- High overhead - open/close of circuit
26Setting up Virtual Connections
SYN
Requests a virtual circuit (TCP connection) and
negotiates packet size with B
SYN
SYN
Data 1
Data 2
Sends data packets one by one (in order) using
continuous ARQ (sliding window)
ACK 2
Data 3
Data 4
FIN
Closes virtual circuit
not busy
27Connectionless Routing
- Each packet of a large transmission is treated
separately and makes its own way through the
network without a virtual circuit - Packets may travel different routes and at
different speeds through the network - Sequence number must be added to each packet by
the Network layer - Network layer at receivers side must reassemble
packet in sequence
28Connectionless vs. Connection-Oriented Routing
- TCP/IP,IPX/SPX, X.25, and SNA can all operate as
connection-oriented or connectionless. - When connection-oriented routing is needed, both
the transport layer protocol and network protocol
are used. The transport layer protocol
establishes the virtual circuit and the network
layer routes the messages. - In TCP/IP when connectionless routing is desired,
only IP is needed, and the TCP packet is replaced
with a User Datagram Protocol (UDP) packet.
29UDP - User Datagram Protocol
- Protocol used for connectionless routing in
TCP/IP suite (no acks, no flow control) - Uses only a small packet header
- Only 8 bytes containing only 4 fields
- Source port
- Destination port
- Message length
- Header checksum
- Commonly used for control messages that are
usually small, such as DNS, DHCP, RIP and SNMP.
30Quality of Service (QoS) Routing
- A special kind of connection-oriented dynamic
routing - Packets are assigned different priorities
- depending on the type of packet sent
- different classes of service are defined to
determine the priority - Transport layer specifies the class of service
when requesting virtual circuit - Each path designed to support different service
classes or priorities - Real-time applications - highest
- A graphical file for a Web page - a lower
priority - E-mail - lowest (can wait a long time before
delivery)
31QoS - Quality of Service
- QoS parameters
- Availability, Reliability, Timeliness
- Timeliness - timely delivery of packets
- Packets be delivered within a certain period of
time (to produce a smooth, continuous output - Required by some applications, especially real
time applications (e.g., voice and video frames) - (e-mail doesnt require this)
- QoS Protocols
- RSVP
- RTSP
- RTP
32Protocols Supporting QoS
- Asynchronous Transfer Mode (ATM)
- A high-speed data link layer protocol
- TCP/IP protocol suite
- Resource Reservation Protocol (RSVP)
- Sets up virtual circuits for general
purpose real-time applications - Real-Time Streaming Protocol (RTSP)
- Sets up virtual circuits for audio-video
applications - Real-Time Transport Protocol (RTP)
- Used after a virtual connection setup by RSVP or
RTSP - Adds a sequence number and a timestamp for
helping applications to synchronize delivery - Uses UDP (because of its small header) as
transport
RTSP
RSVP
RTP
UDP
IP
33Transport and Network Protocols - Summary
Routing and Addressing
Packetizing
TCP
IP
TCP/IP
IPX
SPX
IPX/SPX
X.25
X.3
PLP
Transmission Control Layer
SNA
Path Control Layer
34Network Layer Functions
- Addressing
- Each equipment on the path between source and
destination must have an address - Internet Addresses
- Assignment of addresses
- Translation between network layer addresses and
other addresses (address resolution) - Routing
- Process of deciding what path a packet must take
to reach destination - Routing protocols
35Addressing
Key Concept Each computer has several addresses,
each used by a different layer.
Example Address
Example Software
Address
Application Layer
Web Browser
www.cob.niu.edu
Network Layer
IP
131.156.120.128
Data Link Layer
00-0C-00-F5-03-5A
Ethernet
36Assignment of Addresses
- Application Layer address (URL)
- For servers only (clients dont need it)
- Assigned by network managers and placed in
configuration files. - Some servers may have several application layer
addresses - Network Layer Address (IP address)
- Assigned by network managers, or by programs such
as DHCP, and placed in configuration files - Every network on the Internet is assigned a range
of possible IP addresses for use on its network - Data Link Layer Address (MAC or Physical address)
- Unique hardware addresses placed on network
interface cards by their manufacturers ( based on
a standardized scheme) - Servers have permanent addresses, clients usually
do not
37ICANN
- Internet Corporation for Assigned Names and
Numbers (ICANN) - manages the assignment of application layer and
network layer name space or addresses - sets the rules by which new domain names are
created and IP address numbers are assigned - manages a set of Internet domains (.com, .org,
.net) - authorizes private companies to become domain
name registrars - approves request for application layer addresses
and assigns IP numbers for those request - organizations can use any registered company for
the specific domain for a fee
38Addressing
Dotted Decimal Notation
IPv4 address is four bytes long (strings of 32
binary bits)
Address Class
0
7 8
31
Host number
Network number
1.0.0.0 to 126.0.0.0 2 Billion
A
0
16 million user addresses
15 16
31
0
1
128.1.0.0 to 191.254.0.0 1 Billion
B
Network number
Host number
0
1
65,000 user addresses
0
1
31
23 24
192.0.1.0 to 223.255.254.0 536Million
Network number
Host number
C
0
1
1
254 addresses
Assigned by ICANN
39IPv6 Addressing
- Need
- IPv4 uses 4 byte addresses
- Total of three billion possible addresses
- IP addresses often assigned in (large) groups
- Giving out many numbers at a time
- ? IPv4 address space has been used up quickly
- e.g., Indiana University uses a Class B IP
address space (65,000 addresses many more than
needed) - IPv6 uses 16 byte addresses
- 3.2 x 1038 addresses, a very large number
- Little chance this address space will ever be
used up
40Subnets
- Each organization assigns IP addresses it has
received to specific computers on its networks - IP addresses are assigned so that all computers
on the same LAN have similar addresses (those
with the same prefix) - Each of these LANs is known as a TCP/IP subnet
- Any portion of the IP address can be designated
as a subnet using a subnet mask
41Subnet Addressing
Figure 5.7
42Subnets
- Group of computers on the same LAN with IP
numbers with the same prefix - Assigned addresses that are 8 bits in length
- For example
- Subnet 128.192.56.x
- Computers in Business (x is between 0 254)
- Subnet 128.192.55.x
- Computers in CS department
- Assigned addresses could be more or less than
eight bits in length - For example If 7 bits used for a subnet
- Subnet 1 128.192.56.1-128
- Subnet 2 128.192.56.129-254
43Subnet Addressing
- Subnet masks are used to make it easier to
separate the network part of the address from the
host part. - Suppose that the first two bytes are the subnet
indicator with addresses of the form 131.156.x.x - Then, 131.156.29.156 and 131.156.34.215 would be
on the same subnet. - The subnet mask would be 255.255.0.0, which
corresponds to 11111111.11111111.00000000.00000000
, where 1 indicates that the position is part of
the specific subnet (network) and a 0 indicates
that it is not (it is the host id).
44Subnet Addressing
- Example 2
- Partial bytes can also be used as subnets.
- For example, consider the subnet mask
255.255.255.128, which is 11111111.11111111.111111
11.10000000. - Here, all computers with the same first three
bytes and last byte from either 0-127 or 128 to
254 would be on the same subnet.
45Providing Addresses
- There are two ways of providing addresses to
networked computers. - Static addressing
- Dynamic addressing
46Static Addressing
- Each computer is given an address through a
configuration file - Stored on individual computers
- Problems
- moves, changes, adds and deletes
- individuals could change their own IP address
- network renumbered
- Most companies do not have a good way of tracking
the addresses
47Dynamic Addressing
- Server supplies a network layer address
automatically - each time user logs in or connects to the network
- for a specific lease period
- eliminates permanent addresses to clients
- when a computer is moved to another location it
is automatically assigned a new IP address - Makes efficient use of IP address space
- For example a small ISP with several thousands
subscribers Might only need to assign 500 IP
addresses to clients at any one time
48Dynamic Addressing Programs
- Bootstrap Protocol (bootp)
- Dynamic Host Control Protocol (DHCP)
- Different approaches, but the same basic
operation - Software installed on the client instructs the
client to contact the server using data link
layer addresses (MAC address) - Broadcasts a message asking the server to assign
the client a unique network layer address (IP
address) - Server runs corresponding software that sends the
client its network address and subnet mask - server maintains a IP address pool for
distribution - assigns the same network layer address to the
client each time the client requests it (bootp) - lease the network address from the next available
on a list of authorized addresses for as long as
the client is connected or for a specified amount
of time (DHCP)
49Address Resolution
- The process of
- translating an application layer address (server
name) to a network address (server name
resolution) - translating the network layer address to a data
link layer address (data link layer address
resolution)
50Server Name Resolution
- accomplished by the use of Domain Name Service
(DNS) - computers called name servers provide these DNS
services - address data base includes server names and
their corresponding IP address - Large organizations maintain their own name
servers - When a domain name is registered, the IP address
of the DNS server must be provided to the
registrar for all URLS in this domain
51University of North Texas
DNS Server sol.acs.unt.edu 129.120.220.42
DNS Response
DNS Request
Client computer
LAN
DNS Request
DNS Response
Root DNS Server for .EDU domain
Internet
DNS Request
Northern Illinois University
DNS Server netmgr.cso.niu.edu 131.156.1.11
LAN
DNS Response
Figure 5.8 modified
52MAC Address Resolution
- broadcast message is sent to all computers in its
subnet to identify the MAC address of the next
node that the packet must be forwarded to - if your IP address is xxx.yyy.zzz.ttt, please
send your data link layer address - uses Address Resolution Protocol (ARP)
- Broadcast an ARP message to all nodes on a LAN
asking which node has a certain IP address - Host with that IP address then responds by
sending back its MAC address - Store this MAC address in its address table
- Send the message to the destination node
53Network Routing
- The process of determining the route or path a
message will take through the network from the
sender to the receiver - centralized
- decentralized
- static routing
- dynamic routing
- broadcast Or multicast routing
- connectionless
- connection-oriented routing
54Routing Tables
- Routing Tables
- Used to make routing decisions
- Shows which path to send packets on
to reach a given destination - Kept by computers making routing decisions
- Routers
- Special purpose devices used to handle
routing decisions on the Internet - Maintain their own routing tables
55Route and Route Table
Computer B Destination Next
Computer Route A A C C D A E E
F E G C
C
B
G
A
F
D
Each node has its own routing table
E
56Internet Routes
NIU Destination Route U NorthTexas
Texas Oxford Europe U of Toronto Canada U of
Singapore Asia UC Stanford West Coast Other
Other
57Types of Routing
- Centralized routing
- Decentralized routing
- static
- dynamic
- Other types
- broadcast routing
- multicast routing
58Centralized Routing
- All routing decisions are made by one computer
- Used on small, mainframe-based networks
- star topologies
- mesh topologies
- Routing tables located on each computer
- central computer sends updated tables as needed
- routing table tells the device where to send
messages - Simplicity - no wasted resources
- Hardware failures or changing conditions cause
table to be out of sync
59Decentralized Routing
- Each of the following types of routing fall under
the heading of decentralized routing - Each device makes its own routing decisions with
the use of a formal routing protocol - Routing protocols are self-adjusting
- can automatically adapt to changes in the network
configuration - Drawbacks
- slows down the network with status messages
- requires more processing by each computer
60Static Decentralized Routing
- Routing table developed by the network manager or
some type of committee - initial table sent to each computer which then
updates the routing table as needed - reroutes as needed with down or removed circuits
- updated when new devices announce their presence
- used in relatively static networks that have few
routing options
61Dynamic Decentralized Routing (Adaptive)
- Routing messages over the fastest route
- used when there are multiple routes in the
network - improves network performance by selecting the
fastest route to avoid bottlenecks or busy
circuits - initial table developed by network manager
- dynamically updated with changing conditions by
the devices themselves - monitors message transmission time or each
device reports how busy it is to avoid
bottlenecks - Disadvantages
- requires more processing by each computer
- wastes network capacity
62Dynamic Routing Algorithms
- Distance vector
- the number of hops along a route
- exchange information with the neighboring
computers every few minutes - Link state
- the number of hops along a route
- the speed of the circuits on the route
- how busy the route is
- exchanges information with other routing devices
every 15-30 minutes - tries to determine the fastest/cheapest route
- converges reliable routing information more
quickly
63Routing Protocols
- Used to exchange info among nodes for building
and maintaining routing tables - Autonomous System (AS)
- A network operated by an organization (e.g.,
Indiana U.) - Protocols classified based on autonomous systems
- Types of Routing Protocols
- Interior routing protocols (RIP, OSPF, EIGRP,
ICMP) - Operate within a network (autonomous system)
- Provide detailed info about each node and paths
- Exterior routing protocols (BGP)
- Operate between networks (autonomous systems)
64Routing Protocols
- Border Gateway Protocol
- Internet Control Message Protocol
- Routing Information Protocol
- Open Shortest Path First
- Enhanced Interior Gateway Routing Protocol
65Routing Protocols
- BGP (Border Gateway Protocol)
- exchanges information between autonomous systems
about the condition of the Internet - dynamic distance vector exterior routing protocol
- provides routing on only selected or preferred
routes - complex, hard to administer, privacy concerns
- ICMP (Internet Control Message Protocol)
- simple, interior routing protocol used with the
Internet - reports routing errors but is limited in the
ability to update - RIP (Routing Information Protocol)
- dynamic distance vector interior routing protocol
- counts the number of devices on each route
- selects the route with the least number of devices
66Routing Protocols
- OSPF (Open Shortest Path First)
- link state interior routing protocol used on the
Internet - counts number of computers, network traffic,
network error rates to select the best route - only sends updates to routing devices/ no
broadcasting - preferred TCP/IP, but also used by IPX/SPX
- EIGRP (Enhanced Interior Gateway Routing
Protocol) - link state interior routing protocol developed by
CISCO - uses route transmission capacity, delay,
reliability and load to select best route - stores multiple routing tables
- SAP (Service Advertisement Protocol)
- Netware servers send SAP advertisements
- Novells broadcast protocol
67Internet Routing using BGP, OSPF and RIP
RIP
68Broadcast Routing
- Sends the message to all computers on the network
- Only computer with correct address processes the
message - Used only in bus networks
- Wastes network bandwidth
69Multicasting
- Casting
- Unicast message one computer ? another computer
- Multicast message one computer ? a group of
computers (e.g., videoconference) - Internet Group Management Protocol (IGMP)
- Provides a way for a computer to report its
multicast group membership to adjacent routers - A special IP address assigned to identify the
group (class D IP address) - Routing node sets MAC address to a matching MAC
address - When multicast session ends, IGMP sends a message
to the organizing computer( or router) to remove
multicast group
70Requirements for TCP/IP
- This information should either come from an
internal configuration file or a bootp or DHCP
server - IP address
- Subnet mask
- IP address of DNS server
- IP address of router, gateway or switch
71Known Address, Same Subnet
- A Client (128.192.98.130) requests a Web page
from a server (www1.anyorg.com) and knows the
servers IP and MAC address - Prepare HTTP packet and send it to TCP
- Place HTTP packet into a TCP packet and sent it
to IP - Place TCP packet into an IP packet, add
destination IP address, 128.192.98.53 - Use its subnet mask to see that the destination
is on the same subnet as itself - Add servers Ethernet address into its
destination address field, and send the frame to
the Web server
72HTTP response to client
- Server
- Receives the Ethernet frame, performs error
checking and send back an ACK - Process incoming frame successively up the layers
(data link, network, transport and application)
until the HTTP request emerges - Process HTTP request and sends back an HTTP
response (with requested Web page) - Process outgoing HTTP response successively down
the layers until an Ethernet frame is created - Send Ethernet frame to the client
- Operations (performed by the client)
- Receive Ethernet frame and process it
successively up the layers until the HTTP
response emerges at browser
73Known Address, Different Subnet
- Similar to known address, same subnet
- Differences
- Use subnet mask to determine that the destination
is NOT on the same subnet - Send outgoing frames to the local subnets GW
- Local gateway operations
- Receive the frame and remove the Ethernet header
- Determine the next node (via Router Table)
- Make a new frame and send it to the destination
GW - Destination gateway operations
- Remove the header, determine the destination (by
destination IP address) - Place the IP packet in a new Ethernet frame and
send it to its final destination.
74Unknown Address
- Operations (by the host)
- Determine the destination IP address
- Send a UDP packet to the local DNS server
- Local DNS server knows the destination hosts IP
address - Sends a DNS response back to the sending host
- Local DNS server does not know the destination IP
address - Send a second UDP packet to the next highest DNS
host, and so on, until the destination hosts IP
address is determined - Same as previous
75TCP Connections
- Before any data packet is sent, a connection is
established - Use SYN packet to establish connection
- Use FIN packet to close the connection
- Handling of HTTP packets
- Old version
- a separate TCP connection for each HTTP Request
- New version
- Open a connection when a request (first HTTPP
Request) send to the server - Leave the connection open for all subsequent HTTP
requests to the same server - Close the connection when the session ends
76TCP/IP and Layers
- Host Computers
- Packets move through all layers
- Gateways, Routers
- Packet moves from Physical layer to Data Link
Layer through the network Layer - At each stop along the way
- Ethernet packets is removed and a new one is
created for the next node - IP and above packets never change in transit
(created by the original sender and destroyed by
the final receiver)
77Message Moves Through Layers
Figure 5.16
78Implications for Management
- Most organizations moving toward a single
standard, TCP/IP - Decreased cost of buying and maintaining network
equipment - Decreased cost of training networking staff
- Telephone companies (having large non-TCP/IP
networks) moving toward TCP/IP - Significant financial implications for telcos
- Significant financial implications of networking
equipment manufacturers