Вы находитесь на странице: 1из 162

Using Layer Models

To visualize the interaction between


various protocols, it is common to use a
layered model.
A layered model depicts the operation
of the protocols occurring within each
layer, as well as the interaction with the
layers above and below it

3/14/2015 1
Benefits Using Layer Models
Assists in protocol design, because protocols that
operate at a specific layer have defined information
that they act upon and a defined interface to the
layers above and below.
Fosters competition because products from different
vendors can work together.
Prevents technology or capability changes in one
layer from affecting other layers above and below.
Provides a common language to describe networking
functions and capabilities.

3/14/2015 2
Benefits Using Layer Models

3/14/2015 3
Protocol and reference Model
There are two basic types of networking
models:
protocol models and
reference models

3/14/2015 4
Protocol Model
A protocol model provides a model
that closely matches the structure of a
particular protocol suite.
The hierarchical set of related protocols
in a suite typically represents all the
functionality required to interface the
human network with the data network.
Ex: TCP/IP model
3/14/2015 5
Reference Model
A reference model provides a common reference
for maintaining consistency within all types of
network protocols and services.
A reference model is not intended to be an
implementation specification or to provide a sufficient
level of detail to define precisely the services of the
network architecture.
The primary purpose of a reference model is to aid in
clearer understanding of the functions and process
involved
Ex: OSI model

3/14/2015 6
OSI reference model
The Open Systems Interconnection (OSI) model is
the most widely known internetwork reference model
It is used for data network design, operation specifications,
and troubleshooting.
The OSI reference model is the primary model for network
communications
Allows you to view the network functions that occur at each
layer
It is a framework that you can use to understand how
information travels throughout a network
7 layers -- each of which illustrates a particular network
function

3/14/2015 7
OSI 7 layers

3/14/2015 8
Models Provide Guidance

3/14/2015 9
OSI The Application Layer

Provides network
services to the user's
applications.
It does not provide
services to any other
OSI layer
***Think of any
network application you
use daily

3/14/2015 10
OSI The Presentation Layer
It ensures that the
information that the
application layer of one
system sends out is
readable by the
application layer of
another system.
*** Think of any
common file formats
(JPEG, txt etc)

3/14/2015 11
OSI The Session Layer
*** After you prepare
your data, you need to
establish the
communication channels
to send data
This layer establishes,
manages, and terminates
sessions between two
communicating hosts.
It also synchronizes
dialogue between the
two hosts' presentation
layers and manages their
data exchange.
3/14/2015 12
OSI The Transport Layer
Data will be
segmented and send
to destination device.
Transport layer of
destination device will
reassemble them.
This layer handles
details of reliable
transfer. (ensures
that the data arrive
completely )

3/14/2015 13
OSI The Network Layer

Many paths to the


same destination. So,
which path to follow?
Segmented data needs
address to reach the
destination (network
address)
This layer handle 2
above stated issues.

3/14/2015 14
OSI The Data Link Layer

It provides means for


exchanging data frames
over a common media
To detect and possibly
correct errors that may
occur in the Physical
layer
Physical Addressing,
topologies and flow
control

3/14/2015 15
OSI The Physical Layer

It defines the electrical,


mechanical, procedural,
and functional
specifications for
activating, maintaining,
and deactivating the
physical link between end
systems.
Voltage levels, timing of
voltage changes, physical
data rates, maximum
transmission distances,
physical connectors, and
other, similar, attributes
defined by physical layer
specifications.
3/14/2015 16
TCP/IP Model

3/14/2015 17
Comparison
--Both have application
layers, though they include
very different services
--Both have comparable
transport and network
(Internet) layers
--TCP/IP combines the
presentation and session
layer issues into its
application layer
--TCP/IP combines the OSI
data link and physical layers
into one layer
--TCP/IP appears simpler
because it has fewer layers

3/14/2015 18
Protocol Data Unit(PDU) and
Encapsulation
As application data is passed down the
protocol stack on its way to be transmitted
across the network media, various protocols
add information to it at each level. This is
commonly known as the encapsulation
process.
The form that a piece of data takes at any
layer is called a Protocol Data Unit (PDU)

3/14/2015 19
Protocol Data Unit(PDU) and
Encapsulation
During encapsulation, each succeeding layer
encapsulates the PDU that it receives from the layer
above in accordance with the protocol being used.
At each stage of the process, a PDU has a different
name to reflect its new appearance. Although there is
no universal naming convention for PDUs, in this
course, the PDUs are named according to the
protocols of the TCP/IP suite.

3/14/2015 20
Name of PDUs according to the
protocols of the TCP/IP suite.

Data - The general term for the PDU


used at the Application layer
Segment - Transport Layer PDU
Packet - Internetwork Layer PDU
Frame - Network Access Layer PDU
Bits - A PDU used when physically
transmitting data over the medium

3/14/2015 21
Encapsulation

3/14/2015 22
Data Encapsulation
Build the data
Package the data for
end to end support
(Segments)
The data is put into a
packet or datagram
that contains a
network header with
source and destination
logical addresses

3/14/2015 23
Data Encapsulation
Each network device
must put the packet
into a frame.
The frame must be
converted into a pattern
of 1s and 0s (bits)
***Data Segments
Packet Frames
Bits

3/14/2015 24
Addressing in the Network
There are various types of addresses that must be
included to successfully deliver the data from a
source application running on one host to the
correct destination application running on another

3/14/2015 25
Application Layer Functionality
and Protocols

3/14/2015 26
Applications The Interface Between
Human and Data Networks

People use application that


enables them to send and
receive data as well as sharing
data without understanding
how they work.
As network professionals it is
important to know how they
work and how they format,
send and interpret the data.
This can be achieved easier by
using the OSI layered model

3/14/2015 27
TCP/IP Application layer
protocols
There are widely used and commonly known
TCP/IP Application layer protocols that are
used
Domain Name Service Protocol
(DNS) is used to resolve Internet names
to IP addresses
Hypertext Transfer Protocol (HTTP)
is used to transfer files that make up the
Web pages of the World Wide Web
Simple Mail Transfe Protocol
(SMTP) is used for the transfer of mail
messages and attachments
Telnet, a terminal emulation protocol, is
used to provide remote access to servers
and networking devices
File Transfer Protocol (FTP) is used
for interactive file transfer between
systems
3/14/2015 28
Application Layer Software
Within the Application layer, there are two
forms of software programs or processes
that provide access to the network:
applications and
services
Network-Aware Application: they
implement the application layer protocols
and are able to communicate directly with
the lower layers of the protocol stack
e.g. E-mail clients and web browsers

3/14/2015 29
Application Layer Software
Application Layer Services: Other programs
may need the assistance of Application layer
services to use network resources, like file
transfer or network print spooling.
These services are the programs that interface
with the network and prepare the data for transfer
Each application or network service uses
protocols which define the standards and
data formats to be used

3/14/2015 30
DNS Services and Protocol
The Transport layer uses an addressing scheme called a port
number
Port numbers identify applications and Application layer services
that are the source and destination of data
Some common port numbers are
Domain Name System (DNS) - TCP/UDP Port 53
Hypertext Transfer Protocol (HTTP) - TCP Port 80
Simple Mail Transfer Protocol (SMTP) - TCP Port 25
Post Office Protocol (POP) - UDP Port 110
Telnet - TCP Port 23
Dynamic Host Configuration Protocol - UDP Port 67
File Transfer Protocol (FTP) - TCP Ports 20 and 21

3/14/2015 31
DNS Services and Protocol
Each device on a network is identified by an IP
address
On the Internet it is difficult to remember all the IP
addresses so domain names are created
The Domain Name System (DNS) was created for
domain name to address resolution
DNS uses a distributed set of servers to resolve the
names associated with these numbered addresses.
The DNS protocol defines an automated service that
matches resource names with the required numeric
network address

3/14/2015 32
DNS Services and Protocol

3/14/2015 33
DNS Services and Protocol
A DNS server provides the name resolution using the name daemon,
called named, (pronounced name-dee).
The DNS server stores different types of resource records used to resolve
names. These records contain the name, address, and type of record
A - an end device address
NS - an authoritative name server
CNAME - the canonical name (or Fully Qualified Domain Name) for an alias;
used when multiple services have the single network address but each service
has its own entry in DNS
MX - mail exchange record; maps a domain name to a list of mail exchange
servers for that domain
When a client makes a query, the server's "named" process first looks at
its own records to see if it can resolve the name. If it is unable to resolve
the name using its stored records, it contacts other servers in order to
resolve the name.

3/14/2015 34
WWW Service and HTTP
When a web address (or URL) is
typed into a web browser, the
web browser establishes a
connection to the web service
running on the server using the
HTTP protocol
In order to access the content,
web clients make connections to
the server and request the
desired resources

The URL http://www.cisco.com/index.html is an example of a URL that refers


to a specific resource - a web page named index.html on a server identified as
cisco.com
The server replies with the resources and, upon receipt, the browser interprets the
data and presents it to the user (may use other services or plug-ins/add-ons)

3/14/2015 35
WWW Service and HTTP
The Hypertext Transfer Protocol (HTTP), one of the protocols in
the TCP/IP suite, was originally developed to publish and retrieve
HTML pages
HTTP specifies a request/response protocol. When a client,
typically a web browser, sends a request message to a server
The three common message types are GET, POST, and PUT
GET is a client request for data. A web browser sends the GET
message to request pages from a web server
POST and PUT are used to send messages that upload data to the
web server
HTTP is not a secure protocol. For secure posting and accessing of
web pages HTTPS protocol is used.

3/14/2015 36
Email Services and SMTP/POP
Protocols
E-mail is a client/server process
E-mail requires several
applications and services like
Application layer protocols, Post
Office Protocol (POP/POP3) and
Simple Mail Transfer Protocol
(SMTP)
When people compose e-mail
messages, they typically use an
application called a Mail User
Agent (MUA), or e-mail client
which enables sending messages
and getting messages into clients
mail box
POP is used for receiving e-mails
while SMTP is used for sending e-
mails
3/14/2015 37
Email Services and SMTP/POP
Protocols

The e-mail server operates two


separate processes:
Mail Transfer Agent (MTA) process is
used to forward e-mail
Mail Delivery Agent (MDA) is used If
the mail is addressed to a user
whose mailbox is on the local server
The MDA can also resolve final
delivery issues, such as virus
scanning, spam filtering, and return-
receipt handling

3/14/2015 38
File Transfer Protocol (FTP)
File Transfer Protocol (FTP) is
an Application layer protocol
FTP client is an application
that runs on a computer that
is used to push and pull files
from a server running the
FTP daemon (FTPd)
FTP client requires two
connections to transfer files
One for FTP commands and
replies (TCP port 21)
Another for file transfer (TCP
port 23)
The client can download
(pull) a file from the server
or, upload (push) a file to the
server
3/14/2015 39
Dynamic Host Configuration
Protocol (DHCP)

DHCP enables devices in a network


environment to obtain IP address and
other information (subnet mask,
gateway, DNS server .. etc)
dynamically from a DHCP server
The DHCP server chooses an address
from a configured range of addresses
called a pool and assigns ("leases") it
to the host for a set period

3/14/2015 40
Dynamic Host Configuration
Protocol (DHCP)
DHCP makes it possible for you to access the
Internet using wireless hotspots at airports or
coffee shops
Many networks use both DHCP and static
addressing
DHCP is used for general purpose hosts such
as end user devices, and fixed addresses are
used for network devices such as gateways,
switches, servers and printers

3/14/2015 41
Dynamic Host Configuration
Protocol (DHCP)
When a DHCP-configured
device boots up or
connects to the network,
the client broadcasts a
DHCP DISCOVER packet
to identify any available
DHCP servers on the
network

3/14/2015 42
Dynamic Host Configuration
Protocol (DHCP)

A DHCP server replies with a DHCP OFFER, which is a lease offer


message with an assigned IP address, subnet mask, DNS server
etc
The client might choose from multiple DHCP OFFERs it receives and
broadcast a DHCP REQUEST
If the DHCP OFFER is still available the DHCP server will reply with
DHCP ACKNOWLEDGE
If the DHCP OFFER is not available the server with reply with DHCP
NAK the process will start all over again

3/14/2015 43
File Sharing Services and SMB
Protocol
The Server Message
Block (SMB) is a
client/server file sharing
protocol
Developed by IBM in
the late 1980s to
describe the structure
of shared network
resources, such as
directories, files,
printers, and serial
ports
It is a request-response
protocol

3/14/2015 44
Features, Operation, and Use of
TCP/IP Application Layer Services
Telnet is a protocol and a service that
provides text-based terminal emulation to
connect to remote devices over the
network
A connection using Telnet is called a Virtual
Terminal (VTY) session, or connection
To support Telnet client connections, the
server runs a service called the Telnet
daemon. A virtual terminal connection is
established from an end device using a
Telnet client application
Telnet does not support the transport of
encrypted data. All data exchanged during
a Telnet sessions is transported as plain
text across the network
If security is a concern then the Secured
Shell (SSH) should be used

3/14/2015 45
OSI Transport Layer

3/14/2015 46
Transport Layer Role and
Services
Tracking the individual communication
between applications on the source and
destination hosts
Segmenting data and managing each piece
Reassembling the segments into streams of
application data
Identifying the different applications

3/14/2015 47
Transport Layer Role and
Services

Explain the
purpose of the
Transport layer

3/14/2015 48
Transport Layer Role and
Services
Major
functions of
the transport
layer and the
role it plays
in data
networks

3/14/2015 49
Transport Layer Role and
Services

Separating
Multiple
Communica
tions

3/14/2015 50
Transport Layer Role
and Services

3/14/2015 51
Transport Layer Role and
Services

Controlling the
conversation
Establishing a
session
Reliable
delivery
Same order
delivery
Flow control
3/14/2015 52
Transport Layer Role and
Services
Supporting
Reliable
Communication
At the Transport
layer the three
basic operations
of reliability are:
tracking transmitted
data
acknowledging received
data
retransmitting any
unacknowledged data

3/14/2015 53
Transport Layer Protocols
TCP and UDP
Transmission Control Protocol (TCP)
TCP is a connection-oriented protocol
TCP incurs additional overhead to gain functions.
Additional functions specified by TCP are
the same order delivery,
reliable delivery, and
flow control.

Applications that use TCP are:


Web Browsers
E-mail
File Transfers
3/14/2015 54
Transport Layer Protocols
User Datagram Protocol (UDP)
UDP is a simple, connectionless protocol.
It has the advantage of providing for low overhead data delivery.
The pieces of communication in UDP are called datagrams.
These datagrams are sent as "best effort" by this Transport layer
protocol.
Applications that use UDP include:
Domain Name System (DNS)
Video Streaming
Voice over IP (VoIP)

3/14/2015 55
Port addressing
Identify the conversation
The TCP and UDP based
services keep track of the
various applications that
are communicating.
To differentiate the
segments and datagrams
for each application, both
TCP and UDP have header
fields that can uniquely
identify these applications.
These unique identifiers
are the port numbers.

3/14/2015 56
Port addressing
The Internet Assigned Numbers
Authority (IANA) assigns port numbers.
IANA is a standards body that is
responsible for assigning various
addressing standards.

3/14/2015 57
Port addressing
There are different types of port
numbers:
Well Known Ports (Numbers 0 to 1023)
These numbers are reserved for services and
applications(server part)
Registered Ports (Numbers 1024 to 49151)
These port numbers are assigned to user
processes or applications(client part)

3/14/2015 58
TCP ports

3/14/2015 59
UDP ports

3/14/2015 60
TCP/UDP common ports

3/14/2015 61
Port addressing
Sometimes it is necessary to know which
active TCP connections are open and
running on a networked host.
Netstat is an important network utility that
can be used to verify those connections.
Netstat lists
the protocol in use
the local address and
port number, the foreign address and
port number, and the state of the connection.

3/14/2015 62
Port addressing

3/14/2015 63
Port addressing

3/14/2015 64
Port addressing

3/14/2015 65
Port addressing

3/14/2015 66
Port addressing

3/14/2015 67
TCP server process

the role of port


numbers in
establishing TCP
sessions and
directing segments to
server process

3/14/2015 68
TCP connection establishment
and termination
To establish the connection, the hosts
perform a three-way handshake.
Control bits in the TCP header indicate
the progress and status of the
connection

3/14/2015 69
The three-way handshake
Establishes that the destination device is
present on the network
Verifies that the destination device has an
active service and is accepting requests on
the destination port number that the initiating
client intends to use for the session
Informs the destination device that the
source client intends to establish a
communication session on that port number
3/14/2015 70
The three-way handshake

3/14/2015 71
Application and Operation of TCP Mechanisms

Trace the
steps in the
handshake
in the
establishme
nt of TCP
sessions

3/14/2015 72
Managing TCP sessions
When services send data using TCP,
segments may arrive at their destination out
of order
For the original message to be understood by
the recipient, the data in these segments is
reassembled into the original order
Sequence numbers are assigned in the
header of each packet to achieve this goal

3/14/2015 73
Managing TCP sessions

Segment sequence
numbers enable reliability
by indicating how to
reassemble and reorder
received segments, as
shown in the figure

3/14/2015 74
Managing TCP session
One of TCP's functions is making sure
that each segment reaches its
destination. The TCP services on the
destination host acknowledge the data
that it has received to the source
application.

3/14/2015 75
TCP Acknowledgment and
windowing
The segment header sequence number and
acknowledgement number are used together to
confirm receipt of the bytes of data contained in the
segments. The sequence number is the relative
number of bytes that have been transmitted in this
session plus 1 (which is the number of the first data
byte in the current segment).
TCP uses the acknowledgement number in segments
sent back to the source to indicate the next byte in
this session that the receiver expects to receive. This
is called expectational acknowledgement.
3/14/2015 76
Managing TCP session
In the example in
the figure, the host
on the left is sending
data to the host on
the right. It sends a
segment containing
10 bytes of data for
this session and a
sequence number
equal to 1 in the
header.

3/14/2015 77
Managing TCP session
Looking at this example, if the sending host had to
wait for acknowledgement of the receipt of each 10
bytes, the network would have a lot of overhead. To
reduce the overhead of these acknowledgements,
multiple segments of data can be sent before and
acknowledged with a single TCP message in the
opposite direction. This acknowledgement contains
an acknowledgement number based on the total
number of bytes received in the session.

3/14/2015 78
Managing TCP session
The source is informed that the destination
has received all bytes in this data stream up
to, but not including, the byte indicated by
the acknowledgement number
The sending host is expected to send a
segment that uses a sequence number that is
equal to the acknowledgement number

3/14/2015 79
Managing TCP session
When the sending host on the left receives
this acknowledgement, it can now send the
next segment containing data for this session
starting with byte number 11.
For example, starting with a sequence number of
2000, if 10 segments of 1000 bytes each were
received, an acknowledgement number of 12000
would be returned to the source.

3/14/2015 80
Managing TCP session
The amount of data that a source can
transmit before an acknowledgement
must be received is called the window
size.
Window Size is a field in the TCP
header that enables the management of
lost data and flow control

3/14/2015 81
Managing TCP session
Handling Segment Loss
No matter how well designed a network is,
data loss will occasionally occur. Therefore,
TCP provides methods of managing these
segment losses.
Among these is a mechanism to retransmit
segments with unacknowledged data.

3/14/2015 82
Managing TCP session
A destination host For example, if segments with
service using TCP sequence numbers 1500 to 3000
usually only and 3400 to 3500 were received,
acknowledges data for the acknowledgement number
contiguous sequence would be 3001. This is because
bytes. If one or more there are segments with the
segments are missing, sequence numbers 3001 to 3399
only the data in the that have not been received.
segments that complete
the stream are
acknowledged.
3/14/2015 83
Managing TCP session
Flow control
TCP also provides mechanisms for flow control.
Flow control assists the reliability of TCP
transmission by adjusting the effective rate of
data flow between the two services in the session.
When the source is informed that the specified
amount of data in the segments is received, it can
continue sending more data for this session.

3/14/2015 84
Managing TCP session
See the figure for a
simplified representation of
window size and
acknowledgements.
In this example, the initial
window size for a TCP
session represented is set
to 3000 bytes.
When the sender has
transmitted 3000 bytes, it
waits for an
acknowledgement of these
bytes before transmitting
more segments in this
session.
3/14/2015 85
Flow control
During the delay in receiving the acknowledgement,
the sender will not be sending any additional
segments for this session.
In periods when the network is congested or the
resources of the receiving host are strained, the
delay may increase. As this delay grows longer, the
effective transmission rate of the data for this session
decreases. The slowdown in data rate helps reduce
the resource contention.

3/14/2015 86
Reducing Window Size
Another way to control the data flow is to use
dynamic window sizes.
When network resources are constrained,
TCP can reduce the window size to require
that received segments be acknowledged
more frequently.
This effectively slows down the rate of
transmission because the source waits for
data to be acknowledged more frequently.
3/14/2015 87
Reducing Window Size
The TCP receiving host sends the window
size value to the sending TCP to indicate the
number of bytes that it is prepared to receive
as a part of this session.
If the destination needs to slow down the
rate of communication because of limited
buffer memory, it can send a smaller window
size value to the source as part of an
acknowledgement.
3/14/2015 88
Managing TCP session
As shown in the figure, if a
receiving host has
congestion, it may respond
to the sending host with a
segment with a reduced
window size. In this graphic,
there was a loss of one of
the segments.
The receiver changed the
window field in the TCP
header of the returning
segments in this
conversation from 3000
down to 1500. This caused
the sender to reduce the
window size to 1500.

3/14/2015 89
Managing TCP session
After periods of transmission with no data
losses or constrained resources, the receiver
will begin to increase the window field. This
reduces the overhead on the network
because fewer acknowledgments need to be
sent.
Window size will continue to increase until
there is data loss, which will cause the
window size to be decreased.
3/14/2015 90
Managing TCP session
This dynamic increasing and decreasing of window
size is a continuous process in TCP, which determines
the optimum window size for each TCP session.
In highly efficient networks, window sizes may
become very large because data is not being lost.
In networks where the underlying infrastructure is
being stressed, the window size will likely remain
small.

3/14/2015 91
UDP protocol
communicating with low overhead
UDP is a simple protocol that provides the
basic Transport layer functions
It has a much lower overhead than TCP,
since it is not
connection-oriented and does not provide the
sophisticated retransmission
sequencing and flow control mechanisms

3/14/2015 92
UDP protocol
Key Application layer protocols that use UDP
include:
Domain Name System (DNS)
Simple Network Management Protocol (SNMP)
Dynamic Host Configuration Protocol (DHCP)
Routing Information Protocol (RIP)
Trivial File Transfer Protocol (TFTP)
Online games

3/14/2015 93
UDP protocol

3/14/2015 94
UDP protocol
Because UDP is connectionless, sessions
are not established before
communication takes place as they are
with TCP. UDP is said to be transaction-
based. In other words, when an
application has data to send, it simply
sends the data.

3/14/2015 95
UDP protocol
The UDP PDU is referred to as a
datagram, although the terms segment
and datagram are sometimes used
interchangeably to describe a Transport
layer PDU.

3/14/2015 96
UDP protocol

3/14/2015 97
UDP server process and requests
Like TCP-based applications, UDP-based server
applications are assigned Well Known or Registered
port numbers. When these applications or processes
are running, they will accept the data matched with
the assigned port number.
When UDP receives a datagram destined for one of
these ports, it forwards the application data to the
appropriate application based on its port number.

3/14/2015 98
UDP server process and requests

3/14/2015 99
Request Destination port

3/14/2015 100
Request source port

3/14/2015 101
Response destination port

3/14/2015 102
Response Source port

3/14/2015 103
OSI network Layer

3/14/2015 104
Network Layer

3/14/2015 105
Network Layer Communication
from Host to Host
The Network layer,
or OSI Layer 3,
provides services to
exchange the
individual pieces of
data over the
network between
identified end
devices.

3/14/2015 106
Network Layer
Unlike the Transport layer (OSI Layer 4), which
manages the data transport between the processes
running on each end host, Network layer protocols
specify the packet structure and processing used to
carry the data from one host to another host.
Operating without regard to the application data
carried in each packet allows the Network layer to
carry packets for multiple types of communications
between multiple hosts.

3/14/2015 107
Network Layer
To accomplish this end-to-end
transport, Layer 3 uses 4 basic
processes:
1. Addressing
2. Encapsulation
3. Routing
4. Decapsulation

3/14/2015 108
Network Layer Communication from Host to Host

Addressing
If individual pieces of
data are to be directed
to an end device, that
device must have a
unique address.
When an address is

added to a device, the


device is referred to as
a host.

3/14/2015 109
Network Layer Communication from Host to Host

Encapsulation
Not only the devices be identified with an address, the
individual pieces - the Network layer PDUs - also contain
these addresses.
When referring to the Network layer, we call this PDU a

packet.
The address of the host to which it is being sent. This

address is referred to as the destination address.


The address of the originating host is called the source

address.

3/14/2015 110
Network Layer Communication from Host to Host

Routing
During the routing through an internetwork, the packet

may traverse many intermediary devices.
Each router that a packet takes to reach the next device is called

a hop.
As the packet is forwarded, its contents (Transport layer PDU),
remain intact until the destination host is reached.
If the source and destination hosts are not connected to the same
network.
The Network layer must provide services to direct these packets
to their destination host.
Intermediary devices that connect the networks are called
routers.
The role of the router is to select paths for and direct packets
toward their destination.

3/14/2015 111
Network Layer Communication from Host to Host

Decapsulation
Finally, the packet
arrives at the
destination host and is
processed at Layer 3.
The packet is
decapsulated by the
Network layer and
passed up to the
appropriate service at
Transport layer.

3/14/2015 112
Network Layer Protocols
Protocols implemented at the
Network layer that carry user data
include:
Internet Protocol version 4 (IPv4)
Internet Protocol version 6 (IPv6)
Novell Internetwork Packet Exchange
(IPX)
AppleTalk
Connectionless Network Service
(CLNS/DECNet)
3/14/2015 113
Network Layer Protocols

The Internet Protocol (IPv4


and IPv6) is the most widely-
used Layer 3 data carrying
protocol and will be the focus
of this course

3/14/2015 114
IP V4 Protocol
The Network layer services
implemented by the TCP/IP protocol
suite are the Internet Protocol (IP).
Version 4 of IP (IPv4) is currently the most
widely-used version of IP.
It is the only Layer 3 protocol that is used to
carry user data over the Internet and focus of
the course
IP version 6 (IPv6) is developed and being
implemented in some areas.
IPv6 will operate alongside IPv4 and may
replace it in the future.

3/14/2015 115
IP V4 Protocol

IPv4 basic characteristics:


Connectionless
No connection is established before sending data
packets.
Best Effort (unreliable)
No overhead is used to guarantee packet
delivery.
Media Independent
Operates independently of the medium carrying
the data.

3/14/2015 116
IP V4 Protocol

3/14/2015 117
IP V4 Protocol - Connectionless Service
An example of connectionless communication is sending a
letter to someone without notifying the recipient in
advance.
Connectionless data communications works on the same
principle.
IP packets are sent without notifying the end host that they are
coming.
Connectionless packet delivery may, however, result in
packets arriving at the destination out of sequence.
If out-of-order or missing packets create problems for the
application using the data, then upper layer services will have to
resolve these issues.
3/14/2015 118
IP V4 Protocol - Connectionless Service
Connection-oriented protocols, such
as TCP,
require that control data be exchanged
to establish the connection as well as
additional fields in the PDU header.
IP is connectionless, it requires no initial

exchange of control information to


establish an end-to-end connection, nor
does it require additional fields in the PDU
header to maintain this connection.

3/14/2015 119
Example- postal routes

3/14/2015 120
Example Data Networks

3/14/2015 121
IP V4 Protocol - Best Effort
Service (unreliable)
Since protocols at other layers can
manage reliability, IP is allowed to
function very efficiently at the
Network layer.
As with all layer isolation provided by
network models, leaving the reliability
decision to the Transport layer makes IP
more adaptable and accommodating for
different types of communication.

3/14/2015 122
IP V4 Protocol - Best Effort
Service (unreliable)
IP is often referred to as an unreliable
protocol.
The header of an IP packet does not include
fields required for reliable data delivery.
There are no acknowledgments of packet delivery.
There is no error control for data.
Nor is there any form of packet tracking.
Unreliable in this context does not mean that IP
works properly sometimes and does not function
well at other times.
Unreliable means simply that IP does not have
the capability to manage, and recover from,
undelivered or corrupt packets.

3/14/2015 123
IP V4 Protocol - Best Effort
Service (unreliable)

3/14/2015 124
IP V4 Protocol - Media Independent
The Network layer is also not burdened
with the media on which packets will be
transported.
IPv4 and IPv6 operate independently of the
media that carry the data at lower layers of the
protocol stack.
Any individual IP packet can be communicated
electrically over cable, optical signals over fiber,
or wirelessly as radio signals.
It is the responsibility of the OSI Data Link
layer to take an IP packet and prepare it for
transmission over the communications medium.

3/14/2015 125
IP V4 Protocol - Media Independent
There is, however, one major characteristic of the
media that the Network layer considers:
the maximum size of PDU that each medium can
transport. This characteristic is referred to as the
Maximum Transmission Unit (MTU).
Part of the control communication between the Data Link
layer and the Network layer is the establishment of a
maximum size for the packet
The Network layer then determines how large to create
the packets.
In some cases, an intermediary device , usually a
router will need to split up a packet when
forwarding it from one media to a media with a
smaller MTU.
This process is called fragmenting the packet or
fragmentation.
3/14/2015 126
IP V4 Protocol - Media Independent

3/14/2015 127
IP V4 Packet
IPv4 encapsulates, the Transport layer
segment or datagram so that the network can
deliver it to the destination host.
The process of encapsulating data by layer
enables the services at the different layers to
develop and scale without affecting other layers.
This means that transport layer segments can

be readily packaged by existing Network layer


protocols, such as IPv4 and IPv6 or by any new
protocol that might be developed in the future.
In all cases, the data portion of the packet -

that is, the encapsulated Transport layer PDU -


remains unchanged during the Network layer
processes.

3/14/2015 128
IP V4 Packet
Routers can implement
these different Network
layer protocols to operate
concurrently over a
network to and from the
same or different hosts.
The routing performed by these
intermediary devices only
considers the contents of the
packet header that encapsulates
the segment.

3/14/2015 129
IP V4 Packet Header
As shown in the figure, an IPv4 protocol defines
many different fields in the packet header.
This course will consider these 6 key fields:
IP Source Address
IP Destination Address

Time-to-Live (TTL)

Type-of-Service (ToS)

Protocol

Fragment Offset

IP Source Address (32 bits)


represents the source Network layer host
address.
IP Destination Address (32 bits)
represents the destination Network layer host
address.

3/14/2015 130
Grouping Networks( Separating Hosts into Common
Groups)
As the number of hosts on the network
grows, more planning is required to manage
and address the network.
Rather than having all hosts everywhere
connected to one vast global network, it is
more practical and manageable to group
hosts into smaller networks.
These smaller networks are often called

subnetworks or subnets.
Networks can be grouped based on factors
that include:
Geographic location
Purpose

Ownership

3/14/2015 131
Subnetwork by geographic
location

3/14/2015 132
Subnetwork Network by
Purpose

3/14/2015 133
Subnetwork by ownership

3/14/2015 134
Networks Separating Hosts into
Common Groups

Grouping Hosts
Geographically
Grouping hosts at the
same location - such as
each building on a
campus or each floor of
a multi-level building -
into separate networks
can improve network
management and
operation.

3/14/2015 135
Networks Separating Hosts into
Common Groups
Grouping Hosts for Specific
Purposes
Users who have similar tasks
typically use common
software, common tools, and
have common traffic patterns.
We can often reduce the

traffic by placing the


resources to support them in
the network with the users.
For example, graphic
designers who use the
network to share very large
multimedia files.

3/14/2015 136
Networks Separating Hosts into
Common Groups
Grouping Hosts for
Ownership
Using an
organizational
(company,
department) basis for
creating networks
assists in controlling
access to the devices
and data as well as
the administration of
the networks

3/14/2015 137
Why Separate Hosts into Networks?

Common issues with large networks are:


Performance degradation
Security issues

Address Management

3/14/2015 138
Why Separate Hosts into
Networks? - Performance
Large numbers of hosts connected to a single
network can produce volumes of data traffic that
may stretch, if not overwhelm, network resources
such as bandwidth and routing capability.
Dividing large networks so that hosts who need to
communicate are grouped together reduces the traffic
across the internetworks.

3/14/2015 139
Why Separate Hosts into
Networks? - Performance
In addition to the actual data communications between hosts, network
management and control traffic (overhead) also increases with the number
of hosts. A significant contributor to this overhead is network broadcasts.
A broadcast is a message sent from one host to all other hosts on the network.
And because every other host has to process the broadcast packet it receives,

the other productive functions that a host is performing are also interrupted or
degraded.
However, large numbers of hosts generate large numbers of broadcasts that

consume network bandwidth.


Broadcasts are a necessary and useful tool used by protocols to enable data

communication on networks.
Broadcasts are contained within a network.

In this context, a network is also known as a broadcast domain.

3/14/2015 140
Why Separate Hosts into
Networks? - Performance

3/14/2015 141
Why Separate Hosts into
Networks? - Performance

3/14/2015 142
Why Separate Hosts into
Networks? - Security

The IP-based network that has become the


Internet.
As individuals, businesses, and organizations have
developed their own IP networks that link to the
Internet.
Dividing networks based on ownership means that

access to and from resources outside each network


can be prohibited, allowed, or monitored.

3/14/2015 143
Why Separate Hosts into
Networks? - Security

For example, a college network can be divided into


administrative, research, and student
subnetworks.
Dividing a network based on user access is a means to
secure communications and data from unauthorized
access by users both within the organization and outside
it.
Security between networks is implemented in an

intermediary device (a router or firewall appliance) at the


perimeter of the network.
The firewall function performed by this device permits

only known, trusted data to access the network.

3/14/2015 144
Why Separate Hosts into
Networks? - Security

3/14/2015 145
Why Separate Hosts into
Networks? - Security

3/14/2015 146
Why Separate Hosts into Networks?
Address Management

The Internet consists of millions of hosts,


each of which is identified by its unique
Network layer address.
To expect each host to know the address of
every other host would impose a processing
burden on these network devices that would
severely degrade their performance.

3/14/2015 147
Why Separate Hosts into Networks?
Address Management

Dividing large networks so that hosts who need


to communicate are grouped together reduces
the unnecessary overhead of all hosts needing to
know all addresses.
For all other destinations, the hosts only need to know
the address of an intermediary device, to which they
send packets for all other destinations addresses.
This intermediary device is called a gateway.

The gateway is a router on a network that serves as an


exit from that network.

3/14/2015 148
Why Separate Hosts into Networks?
Address Management

3/14/2015 149
Why Separate Hosts into Networks?
Hierarchical Addressing
postal addresses are prime
To support data communications between examples of hierarchical
networks over internetworks, Network layer addresses.
addressing schemes are hierarchical.
Using hierarchical addressing means that
the layer 3 address are divided into a
network level and then the host level.
Layer 3 addresses supply the network
portion of the address. Routers forward
packets between networks by referring only
to the part of the Network layer address that
is required to direct the packet toward the
destination network.
By the time the packet arrives at the
destination host network, the whole
destination address of the host will have
been used to deliver the packet.
If a large network needs to be divided into
smaller networks, additional layers of
addressing can be created.

3/14/2015 150
Dividing the Networks
Networks from Networks
The logical 32-bit IPv4
address
Are divided in 4 groups of
8 bits (octets).
Each octet is converted to

its decimal value


4 decimal values

separated by a dot
(period).
For example - 192.168.18.57

3/14/2015 151
Dividing the Networks
Networks from Networks
The IPv4 address is hierarchical and is made up of two
parts.
The first part identifies the network and
the second part identifies a host on that network.

Example on previous slide, the first three octets,

(192.168.18), can identify the network portion of the address,


and the last octet, (57) identifies the host.
This is hierarchical addressing because the network portion
indicates the network on which each unique host address is
located.
Routers only need to know how to reach each network, rather
than needing to know the location of each individual host.

3/14/2015 152
Dividing the Networks
Networks from Networks
To further divide a network, the network
portion of the address is extended to use bits
from the host portion of the address.
These borrowed host bits are then used as network
bits to represent the different subnetworks within
the range of the original network.
Given that an IPv4 address is 32 bits, when host
bits are used to divide a network the more
subnetworks created results in fewer hosts for each
subnetwork.

3/14/2015 153
Dividing the Networks
Networks from Networks

3/14/2015 154
Dividing the Networks
Networks from Networks

3/14/2015 155
Dividing the Networks
Networks from Networks
The number of bits of an address used as the
network portion is called the prefix length
(subnet mask ).
For example if a network uses 24 bits to express
the network portion of an address the prefix is
said to be /24.
In the devices in an IPv4 network, a separate 32-
bit number called a subnet mask indicates the
prefix.
Extending the prefix length or subnet mask
enables the creation of these subnetworks.

3/14/2015 156
Support communication
Outside our Network
When a host needs to communicate with
another network, an intermediary device,
or router, acts as a gateway to the other
network.
Within a network or a subnetwork, hosts
communicate with each other without the
need for any Network layer intermediary
device.

3/14/2015 157
Support communication
Outside our Network

3/14/2015 158
A Gateway The way out of Our Network
The gateway, also
known as the default
gateway, is needed to
send a packet out of
the local network.
If the network
portion of the
destination address
of the packet is
different from the
network of the
originating host, the
packet has to be
routed outside the
original network.
To do this, the
packet is sent to
the gateway.

3/14/2015 159
A Gateway The way out of Our Network

The gateway is a router interface connected to


the local network.
The gateway interface has a Network layer address
that matches the network address of the hosts.
The hosts are configured to recognize that address as
the gateway.
Default Gateway
The default gateway is configured on a host.
On a Windows computer, the Internet Protocol
(TCP/IP) Properties tools are used to enter the default
gateway IPv4 address.
Both the host IPv4 address and the gateway address must have the
same network (and subnet, if used) portion of their respective
addresses.
3/14/2015 160
A Gateway The way out of Our Network

3/14/2015 161
A Gateway The way out of Our Network

Confirming the Gateway and


Route
As shown in the figure, the
IP address of the default
gateway of a host can be route print
viewed by issuing the
ipconfig or route print
commands at the command
line of a Windows
computer.
The route command is also

used in a Linux or UNIX


host.

3/14/2015 162