You are on page 1of 18

What is a Network Switch vs. a Router?

What is a network switch and what is a router? The two pieces of equipment look similar and perform
but each has its own distinct function to perform on a network.
What is a Network Switch?
To understand basic networking, you first need to answer the question, "What is a network switch?"

Most business networks today use switches to connect computers, printers and servers within a build
serves as a controller, enabling networked devices to talk to each other efficiently. Through informatio
allocation, switches save businesses money and increase employee productivity.
Understand the different types of Ethernet switches and their capabilities.
What is a Network Switch: Unmanaged Switches

An unmanaged switch works right out of the box. It's not designed to be configured, so you don't have
or setting it up correctly. Unmanaged switches have less network capacity than managed switches. Yo
unmanaged switches in home networking equipment.
What is a Network Switch: Managed Switches

A managed network switch is configurable, offering greater flexibility and capacity than an unmanage
and adjust a managed switch locally or remotely, to give you greater network control.
What is a Network Switch versus a Router?

Switches create a network. Routers connect networks. A router links computers to the Internet, so use
connection. A router acts as a dispatcher, choosing the best path for information to travel so it's recei
What is a Network Switch to My Business?

Switches and routers are the building blocks for all business communications, from data to voice and
They can improve profitability by enabling your company to increase productivity, trim business expe
and customer service.
Find out about Cisco Small Business Switches and Routers, for small and medium-sized businesses.
Next:

Learn more about routing and switching

Find out more about how to connect employees and offices

Explore all enterprise routers and switches

Journey of a Data Packet in the Internet


by HIMANSHU ARORA on AUGUST 8, 2012
While majority of the end-users doesnt care how Internet works, some of you might be
curious to understand the basics of how Internet works.

In this article we will try to peel off the first layer on this topic to understand how Internet
works by elaborating the journey of a data packet from its source to destination on the
Internet. From this perspective, well try to keep the content of this article fairly basic.
Before going further, lets first quickly and briefly understand the concepts of DHCP and DNS.
DHCP
Have you ever thought how your computer gets an IP address? Well, it is important to know
that there are two ways through which a computer gets an IP address. One is static while the
other is dynamic.
Static method is the one in which the computer administrator manually sets the IP address to
the machine. If your machine is connected to a network like LAN then one thing is to be kept
in mind that the IP address being set should not be the same as the IP address of any other
machine on the same network as this may lead to IP address conflict and none of the two
machines will be able to access the internet.
Dynamic method is the one in which the computer (on system boot) asks a server to assign
an IP address to it. The protocol used for this process is known as Dynamic Host Control
Protocol (DHCP). The server referenced here is known DHCP server. This server is responsible
for assigning IP addresses to all the computers on the network. It is the responsibility of the
DHCP server to make sure that there is no IP address conflict. If one of the machine goes
down and then again boots up then a fresh DHCP request is sent to the server which may
assign the same or some different IP address this time. Usually a pool of IP addresses is given
to the DHCP server and it uses only those IP addresses for assignments. This is done to safely
use other IP addresses for static assignments without any conflict.
DNS
Most of us would have used google.com for internet search but have you ever thought on how
it is made sure that typing google.com in our web browser will actually contact the correct
server? Well, to understand this, we need to understand the concept of Domain name server
(DNS).
In real life as people are identified by their name, similarly in computer networks, individual
computers are identified through the IP address assigned to them. IP addresses can be of two
types : public and private. Usually the servers use public IPs as they are contacted by millions
of computers world wide. While your computer which is connected behind the router is usually
assigned private IP. Since there is a limited number of public IPs that are available so the
concept of private IPs in a network (behind a router with public IP) has grown popular and
successful. The broader level concept used for this is known as NAT or Network address
translation.
Remembering IP address is a bit difficult task for humans so each server also has a name (like
google.com). So, end users just need to remember the name and type it in their web browser
and hit enter. Now, the lets come to the story about what happens when the user hits enter
after typing name in web browser. The first thing which is required is to convert the domain
name to the corresponding IP. To accomplish this, a request is sent to the default gateway
(which in most of the cases is the router) to contact the DNS server. The router has a
configured DNS server IP to which this request is sent.
DNS servers are used to convert the domain name to IP address. When a request is received
by the DNS server, it checks whether it has the required information. If this conversion

information is not present then the DNS server forwards this request to the other DNS server.
In this way, the domain name to IP address conversion is done and is sent back.
Once the IP is known then a normal HTTP GET request to that particular IP is made and things
move on.
Post DNS, how things move on?
To understand the following explanation one should have a basic knowledge of TCP/IP protocol
suite layers. Still well try to keep the explanation basic here.

Once the IP address is known through the DNS process, an HTTP GET request is
prepared at the application layer. This request is then forwarded to the Transport layer.

There are two protocols (TCP and UDP) that are majorly used at this layer. It is at this
layer the requests are encapsulated in form of transport layer packets. If TCP is being
used then it also takes care that packet size should not exceed lowest MTU in the path
between source and destination. This is done to avoid fragmentation of packet
somewhere in the middle of its journey. On the other hand if UDP is being used then
this special care is not taken and as a result packets can get fragmented.

Once the packet is formed at transport layer, it is pushed to the IP layer. This layer adds
the information related to source and destination IP addresses and some other
important information like TTL (time to live), fragmentation information etc. All this
information is required while the packet is on its way to the destination.

After this the packet enters the data link layer where the information related to MAC
addresses is added and then the packet is pushed on to the physical layer. So a stream
of 0s and 1s is sent out of your NIC onto the physical media.

If the destination of the packet is not directly connected to the source computer then through
the routing information present on the source computer, the packet is transmitted to the
nearest relevant computer node. There can be various nodes in a network like routers,
bridges, gateways etc. Each entity has its own importance like a router is used for forwarding
the packet, a bridge is used for connecting networks using same protocol while gateways are
used for connecting networks with different protocols.
If we consider a basic network then routers are the main agents which play a vital role in
forwarding the packet from source to destination. When the packet first leaves the source
computer then the mac address of the relevant router (to which the packet is being
transferred) is used as its destination mac address.
When the packet reaches to that router, then the router performs the following action :

It decreases the TTL value and recomputes the check-sum of the packet.

The router searches its routing information table for the complete host address as
specified by the packets destination IP address. If found then router takes action to
forward the packet to the relevant host.

If no such entry is found then the table is searched for the network address derived
from the destination IP. If found then router forwards the packet to that particular
network.

If above two checks fail then the packet is transferred to the the default router as
derived from the default entry in its routing information table.

In any of the above cases, whenever the packet is transferred by router to some other router
or to the destination, the destination mac address of the packet is changed to the immediate
router or destination to which it is being sent. In this way the IP address information in the
packet remains the same but the destination mac address changes from one router to
another. So in this way, the packet travels from one router to another until it reaches the
destination.
Now, at the destination:

The packet is first received at the physical layer which issues an IRQ to the CPU to
indicate that some data is arrived and is waiting to be processed.

After this the data is sent up to the data link layer where MAC layer is checked to see if
this packet is indeed for this computer only.

If the above check is passed then this packet is passed to IP layer where some IP
address checks and check-sum verifications are done and then it is passed on to the
relevant transport layer protocol.

Once this is done, then from the knowledge of the ports the information (or the HTTP
GET request in our case) is passed on the application listening on that port.

This way the request reaches the google web server.

After this the response is formed and transmitted back in the same way as described above.
There you have it. This is how a data packet travels from source to destination in the Internet.
TCP/IP Protocol Fundamentals Explained with a Diagram
by HIMANSHU ARORA on NOVEMBER 2, 2011
Have you ever wondered how your computer talks to other computers on your local LAN or to
other systems on the internet?
Understanding the intricacies of how computers interact is an important part of networking
and is of equal interest to a sysadmin as well as to a developer. In this article, we will make an
attempt to discuss the concept of communication from the very basic fundamental level that
needs to be understood by everybody.
TCP/IP PROTOCOL SUITE
Communications between computers on a network is done through protocol suits. The most
widely used and most widely available protocol suite is TCP/IP protocol suite. A protocol suit
consists of a layered architecture where each layer depicts some functionality which can be
carried out by a protocol. Each layer usually has more than one protocol options to carry out
the responsibility that the layer adheres to. TCP/IP is normally considered to be a 4 layer
system. The 4 layers are as follows :
1. Application layer
2. Transport layer
3. Network layer
4. Data link layer

1. Application layer
This is the top layer of TCP/IP protocol suite. This layer includes applications or processes that
use transport layer protocols to deliver the data to destination computers.
At each layer there are certain protocol options to carry out the task designated to that
particular layer. So, application layer also has various protocols that applications use to
communicate with the second layer, the transport layer. Some of the popular application layer
protocols are :

HTTP (Hypertext transfer protocol)

FTP (File transfer protocol)

SMTP (Simple mail transfer protocol)

SNMP (Simple network management protocol) etc

2. Transport Layer
This layer provides backbone to data flow between two hosts. This layer receives data from
the application layer above it. There are many protocols that work at this layer but the two
most commonly used protocols at transport layer are TCP and UDP.
TCP is used where a reliable connection is required while UDP is used in case of unreliable
connections.
TCP divides the data(coming from the application layer) into proper sized chunks and then
passes these chunks onto the network. It acknowledges received packets, waits for
the acknowledgments of the packets it sent and sets timeout to resend the packets if
acknowledgements are not received in time. The term reliable connection is used where it is
not desired to loose any information that is being transferred over the network through this
connection. So, the protocol used for this type of connection must provide the mechanism to
achieve this desired characteristic. For example, while downloading a file, it is not desired to
loose any information(bytes) as it may lead to corruption of downloaded content.
UDP provides a comparatively simpler but unreliable service by sending packets from one
host to another. UDP does not take any extra measures to ensure that the data sent is
received by the target host or not. The term unreliable connection are used where loss of
some information does not hamper the task being fulfilled through this connection. For
example while streaming a video, loss of few bytes of information due to some reason is
acceptable as this does not harm the user experience much.
3. Network Layer
This layer is also known as Internet layer. The main purpose of this layer is to organize or
handle the movement of data on network. By movement of data, we generally mean routing
of data over the network. The main protocol used at this layer is IP. While ICMP(used by
popular ping command) and IGMP are also used at this layer.
4. Data Link Layer
This layer is also known as network interface layer. This layer normally consists of device
drivers in the OS and the network interface card attached to the system. Both the device
drivers and the network interface card take care of the communication details with the media
being used to transfer the data over the network. In most of the cases, this media is in the

form of cables. Some of the famous protocols that are used at this layer include ARP(Address
resolution protocol), PPP(Point to point protocol) etc.
TCP/IP CONCEPT EXAMPLE
One thing which is worth taking note is that the interaction between two computers over the
network through TCP/IP protocol suite takes place in the form of a client server architecture.
Client requests for a service while the server processes the request for client.
Now, since we have discussed the underlying layers which help that data flow from host to
target over a network. Lets take a very simple example to make the concept more clear.
Consider the data flow when you open a website.

As seen in the above figure, the information flows downward through each layer on the host
machine. At the first layer, since http protocol is being used, so an HTTP request is formed and
sent to the transport layer.
Here the protocol TCP assigns some more information(like sequence number, source port
number, destination port number etc) to the data coming from upper layer so that the
communication remains reliable i.e, a track of sent data and received data could be
maintained.
At the next lower layer, IP adds its own information over the data coming from transport layer.
This information would help in packet travelling over the network. Lastly, the data link layer
makes sure that the data transfer to/from the physical media is done properly. Here again the
communication done at the data link layer can be reliable or unreliable.
This information travels on the physical media (like Ethernet) and reaches the target machine.

Now, at the target machine (which in our case is the machine at which the website is hosted)
the same series of interactions happen, but in reverse order.
The packet is first received at the data link layer. At this layer the information (that was
stuffed by the data link layer protocol of the host machine) is read and rest of the data is
passed to the upper layer.
Similarly at the Network layer, the information set by the Network layer protocol of host
machine is read and rest of the information is passed on the next upper layer. Same happens
at the transport layer and finally the HTTP request sent by the host application(your browser)
is received by the target application(Website server).
One would wonder what happens when information particular to each layer is read by the
corresponding protocols at target machine or why is it required? Well, lets understand this by
an example of TCP protocol present at transport layer. At the host machine this protocol adds
information like sequence number to each packet sent by this layer.
At the target machine, when packet reaches at this layer, the TCP at this layer makes note of
the sequence number of the packet and sends an acknowledgement (which is received seq
number + 1).
Now, if the host TCP does not receive the acknowledgement within some specified time, it re
sends the same packet. So this way TCP makes sure that no packet gets lost. So we see that
protocol at every layer reads the information set by its counterpart to achieve the
functionality of the layer it represents.
PORTS, SERVERS AND STANDARDS
On a particular machine, a port number coupled with the IP address of the machine is known
as a socket. A combination of IP and port on both client and server is known as four tuple. This
four tuple uniquely identifies a connection. In this section we will discuss how port numbers
are chosen.
You already know that some of the very common services like FTP, telnet etc run on well
known port numbers. While FTP server runs on port 21, Telent server runs on port 23. So, we
see that some standard services that are provided by any implementation of TCP/IP have
some standard ports on which they run. These standard port numbers are generally chosen
from 1 to 1023. The well known ports are managed by Internet Assigned Numbers
Authority(IANA).
While most standard servers (that are provided by the implementation of TCP/IP suite) run on
standard port numbers, clients do not require any standard port to run on.
Client port numbers are known as ephemeral ports. By ephemeral we mean short lived. This is
because a client may connect to server, do its work and then disconnect. So we used the term
short lived and hence no standard ports are required for them.
Also, since clients need to know the port numbers of the servers to connect to them, so most
standard servers run on standard port numbers.
The ports reserved for clients generally range from 1024 to 5000. Port number higher than
5000 are reserved for those servers which are not standard or well known.
If we look at the file /etc/services, you will find most of the standard servers and the port on
which they run.

$ cat /etc/services
systat

11/tcp

users

daytime

13/udp

netstat

15/tcp

qotd

17/tcp

msp

18/udp

chargen

quote

19/udp

ftp-data

20/tcp

ftp

21/tcp

ssh

22/tcp

ssh

22/udp

telnet

23/tcp

ttytst source

...
...
...
As you see from the /etc/services file, FTP has port number 21, telent has port number 23 etc.
You can use grep command on this file to find any server and its associated port.
As far as the standards are concerned, the following four organizations/groups manage the
TCP/IP protocol suite. Both the IRTF and the IETF fall under the IAB.
1. The Internet Society (ISOC)
2. The Internet Architecture Board (IAB). The IAB falls under the ISOC.
3. The Internet Engineering Task Force (IETF)
4. The Internet Research Task Force (IRTF)

Hubs vs Switches vs Routers Networking Device Fundamentals


by HIMANSHU ARORA on SEPTEMBER 5, 2013
Most of the systems you are working on might be connected to a hub, or switch, or router.
Probably you never thought about those networking devices, how they work, and the
differences between them.
In this article, well explain the core technical differences between these networking devices.
To understand these, it is also helpful if you have some basic knowledge of different layers
in OSI model of communication.
Hubs

Hubs, also known as repeaters, are network devices that can operate on layer-1 (I.e.
the physical layer) to connect network devices for communication.

Hubs cannot process layer-2 or layer-3 traffic. Layer-2 deals with hardware addresses
and layer-3 deals with logical (IP) addresses. So, hubs cannot process information based
on MAC or IP addresses.

Hubs cannot even process data based on whether it is a uni-cast, broadcast or multicast data.

All that a hub does is that it transfers data to every port excluding the port from where
data was generated.

Hubs work only in half duplex mode I.e. a device connected to a hub can either send or
receive data at a given time.

If more than one device sends out data simultaneously then data collisions happen.

In case of a collision, a hub rejects data from all the devices and signals them to send
data again. Usually devices follow a random timer after which data is sent again to hub.

Hubs are prone to collisions and as more and more devices are added to set up of
multiple hubs, the chances of collisions will increase and hence the overall performance
of network will go down.

Switches

Switches are network devices that operate on layer-2 of OSI model of communication.

Switches are also known as intelligent hubs.

Switches operate on hardware addresses to transfer data across devices connected to


them.

The reason switches are known as intelligent hubs is because they build address table
in hardware to keep track of different hardware addresses and the port to which each
hardware address is associated.

The reason why they are compared to hubs because a switch, when started fresh, acts
just like a hub. Suppose there are 3 devices connected to a switch. Lets call these
devices as deviceA, deviceB and deviceC. Now, after a fresh start, if deviceA sends out
a message to deviceB then just like a hub, switch will send it out to each port. But, it
will store the hardware address and corresponding port in its hardware table. This
means that whenever any other device will send any packet destined to deviceA then
switch will act intelligently and send it to the correct port and not to all the ports. This
way as more and more interaction takes place, the hardware table of switch grows and
after a certain period of time switch becomes full blown intelligent version of a hub.

Switches are often confused with bridges. Though both of them are mostly similar with
major difference being that a switch forwards data at wire speed as it uses special
hardware circuits known as ASICs.

Switches, unlike hubs, support full duplex data transfer communication for each
connected device.

As layer 2 protocols headers have no information about network of data packet so


switches cannot forward data based or networks and that is the reason switches cannot
be used with large networks that are divided in sub networks.

Switches can avoid loops through the use of spanning tree protocol.

Routers

Routers are the network devices that operate at Layer-3 of OSI model of
communication.

As layer-3 protocols have access to logical address (IP addresses) so routers have the
capability to forward data across networks.

Sometimes routers are also known as layer-3 switches.

Routers are far more feature rich as compared to switches.

Routers maintain routing table for data forwarding.

Earlier, routing was slower as compared to switching. This was because of the fact that
routing table lookup time was considerably high. The reason for this was that the
complete packet was fetched into software buffers and then further operations were
carried on it.

Today, operations are done in hardware which has reduced the latency a lot and hence
routers are not considered slower than switches today.

Routers have lesser port densities as compared to switches.

Routers are usually used as a forwarding network elements in Wide Area Networks.

If you are new to networking, it is also important for you to understand thejourney of a data
packet in Internet and TCP/IP fundamentals.
The Difference Between Hubs, Switches and Routers

Related Terms

hub

switching hub

switch

router firmware

IP switching

router

routing switch

switched Ethernet

MPLS - Multiprotocol Label Switching

ACHA

Updated April 22, 2015 / Posted November 17, 2006


By Ron Pacchiano
Have you ever wondered what the difference is among these boxes? Learn the
difference between a router, a switch and a hub.
Some technicians have a tendency to use the terms routers, hubs and switches
interchangeably. One minute they're talking about a switch and discussing router settings the
next. Throughout the conversation, however, they're still looking at only one box. Have you
ever wondered what the difference is among these devices?
Hub, Switch and Router Defined
The functions of the three devices the hub, switch and router are all quite different from
one another, even if at times they are all integrated into a single device. Which one do you
use when? Let's take a look...
Hub
A common connection point for devices in a network. Hubs are commonly used to
connect segments of aLAN. A hub contains multiple ports. When a packet arrives at one port,
it is copied to the other ports so that all segments of the LAN can see all packets.

Cost-Effective Scalable Storage for the Enterprise


Download Now
Switch
In networks, a device that filters and forwards packets between LAN segments. Switches
operate at the data link layer (layer 2) and sometimes the network layer (layer 3) of the OSI
Reference Model and therefore support any packet protocol. LANs that use switches to
join segments are called switched LANs or, in the case of Ethernet networks, switched
Ethernet LANs.
Router
A device that forwards data packets along networks. A router is connected to at least two
networks, commonly two LANs or WANs or a LAN and its ISP.s network. Routers are located
at gateways, the places where two or more networks connect. Routers use headers and
forwarding tables to determine the best path for forwarding the packets, and they
use protocols such as ICMP to communicate with each other and configure the best route
between any two hosts.
The Differences Between Hubs, Switches, and Routers on the Network

Today most routers have become something of a Swiss Army knife, combining the features
and functionality of a router and switch/hub into a single unit. So conversations regarding
these devices can be a bit misleading especially to someone new to computer networking.
The functions of a router, hub and a switch are all quite different from one another, even if at
times they are all integrated into a single device. Let's start with the hub and the switch since
these two devices have similar roles on the network.
The Hub and Switch Have Similar Roles
Each serves as a central connection for all of your network equipment and handles a data
type known as frames. Frames carry your data. When a frame is received, it is amplified and
then transmitted on to the port of the destination PC. The big difference between these two
devices is in the method in which frames are being delivered.
In a hub, a frame is passed along or "broadcast" to every one of its ports. It doesn't matter
that the frame is only destined for one port. The hub has no way of distinguishing which port a
frame should be sent to. Passing it along to every port ensures that it will reach its intended
destination. This places a lot of traffic on the network and can lead to poor network response
times.
Additionally, a 10/100Mbps hub must share its bandwidth with each and every one of its
ports. So when only one PC is broadcasting, it will have access to the maximum available
bandwidth. If, however, multiple PCs are broadcasting, then that bandwidth will need to be
divided among all of those systems, which will degrade performance.
A switch, however, keeps a record of the MAC addresses of all the devices connected to it.
With this information, a switch can identify which system is sitting on which port. So when a
frame is received, it knows exactly which port to send it to, without significantly increasing
network response times. And, unlike a hub, a 10/100Mbps switch will allocate a full
10/100Mbps to each of its ports. So regardless of the number of PCs transmitting, users will
always have access to the maximum amount of bandwidth. It's for these reasons a switch is
considered to be a much better choice than a hub.
Routers are Completely Different Devices
Routers are completely different devices. Where a hub or switch is concerned with
transmitting frames, a router's job, as its name implies, is to route packets to other networks
until that packet ultimately reaches its destination. One of the key features of a packet is that
it not only contains data, but the destination address of where it's going.
A router is typically connected to at least two networks, commonly two Local Area Networks
(LANs) or Wide Area Networks (WAN) or a LAN and its ISP's network . for example, your PC or
workgroup and EarthLink. Routers are located at gateways, the places where two or more
networks connect. Using headers and forwarding tables, routers determine the best path for
forwarding the packets. Router use protocols such as ICMP to communicate with each other
and configure the best route between any two hosts.
Features of Integrated Routers
Today, a wide variety of services are integrated into most broadband routers. A router will
typically include a 4 - 8 port Ethernet switch (or hub) and a Network Address Translator (NAT).
In addition, they usually include a Dynamic Host Configuration Protocol (DHCP) server,
Domain Name Service (DNS) proxy server and a hardware firewall to protect the LAN from

malicious intrusion from the Internet.


All routers have a WAN Port that connects to a DSL or cable modem for broadband Internet
service and the integrated switch allows users to easily create a LAN. This allows all the PCs
on the LAN to have access to the Internet and Windows file and printer sharing services.
RECOMMENDED READING: Did You Know...All About Broadband/ICS Routers
Routers might have a single WAN port and a single LAN port and are designed to connect an
existing LAN hub or switch to a WAN. Ethernet switches and hubs can be connected to a
router with multiple PC ports to expand a LAN. Depending on the capabilities (kinds of
available ports) of the router and the switches or hubs, the connection between the router
and switches/hubs may require either straight-thru or crossover (null-modem) cables. Some
routers even have USB ports, and more commonly, wireless access points built into them.
Some of the more high-end or business class routers will also incorporate a serial port that
can be connected to an external dial-up modem, which is useful as a backup in the event that
the primary broadband connection goes down, as well as a built in LAN printer server and
printer port.
Besides the inherent protection features provided by the NAT, many routers will also have a
built-in, configurable, hardware-based firewall. Firewall capabilities can range from the very
basic to quite sophisticated devices. Among the capabilities found on leading routers are
those that permit configuring TCP/UDP ports for games, chat services, and the like, on the LAN
behind the firewall.
So, in short, a hub glues together an Ethernet network segment, a switch can connect
multiple Ethernet segments more efficiently and a router can do those functions plus
route TCP/IP packets between multiple LANs and/or WANs; and much more of course.
Did You Know... Routers are also the only one of these three devices that will allow you to
share a single IP address among multiple network clients.

Ronald Pacchiano is a contributing writer for SmallBusinessComputing.com and


PracticallyNetworked.com, both are Internet.com sites. .

Description of OSI layers[edit]


The recommendation X.200 describes seven layers, labeled 1 to 7. Layer 1 is the lowest layer
in this model.
OSI Model
Layer

Data unit

Function[3]

Examples

Ho
st
lay
ers

7. Applic
ation

High-level APIs, including resource


sharing, remote file access, directory
servicesand virtual terminals

HTTP, FTP, SMTP, SS


H, TELNET

6. Presen
tation

Translation of data between a


networking service and an
application; includingcharacter
encoding, data
compression and encryption/decrypti
on

HTML, CSS, GIF

5. Sessio
n

Managing communication sessions,


i.e. continuous exchange of
information in the form of multiple
back-and-forth transmissions
between two nodes

RPC, PAP, SSL, SQL

4. Transp
ort

Segments/D
atagram

Reliable transmission of data


segments between points on a
network,
includingsegmentation, acknowledge
ment and multiplexing

TCP, UDP, NETBEUI

Packet

Structuring and managing a multinode network,


including addressing, routing andtra
ffic control

IPv4, IPv6, IPsec, Ap


pleTalk, ICMP

Frame

Reliable transmission of data frames


between two nodes connected by a
physical layer

PPP, IEEE
802.2, L2TP, MAC, LL
DP

Bit

Transmission and reception of raw bit


streams over a physical medium

Ethernet physical
layer, DSL, USB, ISD
N, DOCSIS

3. Netwo
rk
Me
dia
lay
ers

2. Data
link

1. Physic
al

Data

At each level N, two entities at the communicating devices (layer N peers) exchange protocol
data units (PDUs) by means of a layer N protocol. Each PDU contains a payload, called
the service data unit (SDU), along with protocol-related headers and/or footers.
Data processing by two communicating OSI-compatible devices is done as such:
1. The data to be transmitted is composed at the topmost layer of the transmitting device
(layer N) into a protocol data unit (PDU).
2. The PDU is passed to layer N-1, where it is known as the service data unit (SDU).
3. At layer N-1 the SDU is concatenated with a header, a footer, or both, producing a layer
N-1 PDU. It is then passed to layer N-2.
4. The process continues until reaching the lowermost level, from which the data is
transmitted to the receiving device.

5. At the receiving device the data is passed from the lowest to the highest layer as a
series of SDUs while being successively stripped from each layer's header and/or
footer, until reaching the topmost layer, where the last of the data is consumed.
Some orthogonal aspects, such as management and security, involve all of the layers
(See ITU-T X.800 Recommendation[4]). These services are aimed at improving theCIA
triad - confidentiality, integrity, and availability - of the transmitted data. In practice, the
availability of a communication service is determined by the interaction betweennetwork
design and network management protocols. Appropriate choices for both of these are needed
to protect against denial of service.[citation needed]
Layer 1: Physical Layer[edit]
The physical layer has the following major functions:

It defines the electrical and physical specifications of the data connection. It defines the
relationship between a device and a physical transmission medium (e.g., a copper
or fiber optical cable , radio frequency). This includes the layout of pins, voltages,
line impedance, cable specifications, signal timing and similar characteristics for
connected devices and wavelength (5 GHz or 2.4 GHz etc) for wireless devices.

It defines transmission mode i.e. simplex, half duplex, full duplex.

It defines the network topology as bus, mesh, or ring being some of the most common.

The physical layer of Parallel SCSI operates in this layer, as do the physical layers
of Ethernet and other local-area networks, such as Token Ring, FDDI, ITU-T G.hn, andIEEE
802.11 (Wi-Fi), as well as personal area networks such as Bluetooth and IEEE 802.15.4.
Layer 2: Data Link Layer[edit]
The data link layer provides node-to-node data transfer -- a link between two directly
connected nodes. It detects and possibly corrects errors that may occur in the physical layer.
It, among other things, defines the protocol to establish and terminate a connection between
two physically connected devices. It also defines the protocol for flow control between them.
IEEE 802 divides the data link layer into two sublayers:

Media Access Control (MAC) layer - responsible for controlling how devices in a network
gain access to data and permission to transmit it.

Logical Link Control (LLC) layer - responsible for identifying Network layer protocols and
then encapsulating them and controls error checking and packet synchronization.

The MAC and LLC layers of IEEE 802 networks such as 802.3 Ethernet, 802.11 Wi-Fi,
and 802.15.4 ZigBee, operate at the data link layer.
The Point-to-Point Protocol (PPP) is a data link layer that can operate over several different
physical layers, such as synchronous and asynchronous serial lines.
The ITU-T G.hn standard, which provides high-speed local area networking over existing wires
(power lines, phone lines and coaxial cables), includes a complete data link layer that
provides both error correction and flow control by means of a selective-repeat sliding-window
protocol.
Layer 3: Network Layer[edit]

The network layer provides the functional and procedural means of transferring variable
length data sequences (called datagrams) from one node to another connected to the
same network. It translates logical network address into physical machine address. A network
is a medium to which many nodes can be connected, on which every node has
an address and which permits nodes connected to it to transfer messages to other nodes
connected to it by merely providing the content of a message and the address of the
destination node and letting the network find the way to deliver ("route") the message to the
destination node. In addition to message routing, the network may (or may not) implement
message delivery by splitting the message into several fragments, delivering each fragment
by a separate route and reassembling the fragments, report delivery errors, etc.
Datagram delivery at the network layer is not guaranteed to be reliable.
A number of layer-management protocols, a function defined in the management annex, ISO
7498/4, belong to the network layer. These include routing protocols, multicast group
management, network-layer information and error, and network-layer address assignment. It
is the function of the payload that makes these belong to the network layer, not the protocol
that carries them.[5]
Layer 4: Transport Layer[edit]
The transport layer provides the functional and procedural means of transferring variablelength data sequences from a source to a destination host via one or more networks, while
maintaining the quality of service functions.
An example of a transport-layer protocol in the standard Internet stack is Transmission Control
Protocol (TCP), usually built on top of the Internet Protocol (IP).
The transport layer controls the reliability of a given link through flow
control, segmentation/desegmentation, and error control. Some protocols are state- and
connection-oriented. This means that the transport layer can keep track of the segments and
retransmit those that fail. The transport layer also provides the acknowledgement of the
successful data transmission and sends the next data if no errors occurred. The transport
layer creates packets out of the message received from the application layer. Packetizing is a
process of dividing the long message into smaller messages.
OSI defines five classes of connection-mode transport protocols ranging from class 0 (which is
also known as TP0 and provides the fewest features) to class 4 (TP4, designed for less reliable
networks, similar to the Internet). Class 0 contains no error recovery, and was designed for
use on network layers that provide error-free connections. Class 4 is closest to TCP, although
TCP contains functions, such as the graceful close, which OSI assigns to the session layer.
Also, all OSI TP connection-mode protocol classes provide expedited data and preservation of
record boundaries. Detailed characteristics of TP0-4 classes are shown in the following table: [6]
Feature name

TP0

TP1

TP2

TP3

TP4

Connection-oriented network

Yes

Yes

Yes

Yes

Yes

Connectionless network

No

No

No

No

Yes

Concatenation and separation

No

Yes

Yes

Yes

Yes

Segmentation and reassembly

Yes

Yes

Yes

Yes

Yes

Error recovery

No

Yes

Yes

Yes

Yes

Reinitiate connectiona

No

Yes

No

Yes

No

Multiplexing / demultiplexing over single virtual circuit

No

No

Yes

Yes

Yes

Explicit flow control

No

No

Yes

Yes

Yes

Retransmission on timeout

No

No

No

No

Yes

Reliable transport service

No

Yes

No

Yes

Yes

If an excessive number of PDUs are unacknowledged.

An easy way to visualize the transport layer is to compare it with a post office, which deals
with the dispatch and classification of mail and parcels sent. Do remember, however, that a
post office manages the outer envelope of mail. Higher layers may have the equivalent of
double envelopes, such as cryptographic presentation services that can be read by the
addressee only. Roughly speaking, tunneling protocols operate at the transport layer, such as
carrying non-IP protocols such as IBM's SNA orNovell's IPX over an IP network, or end-to-end
encryption with IPsec. While Generic Routing Encapsulation (GRE) might seem to be a
network-layer protocol, if the encapsulation of the payload takes place only at endpoint, GRE
becomes closer to a transport protocol that uses IP headers but contains complete frames or
packets to deliver to an endpoint. L2TP carries PPP frames inside transport packet.
Although not developed under the OSI Reference Model and not strictly conforming to the OSI
definition of the transport layer, the Transmission Control Protocol (TCP) and the User
Datagram Protocol (UDP) of the Internet Protocol Suite are commonly categorized as layer-4
protocols within OSI.
Layer 5: Session Layer[edit]
The session layer controls the dialogues (connections) between computers. It establishes,
manages and terminates the connections between the local and remote application. It
provides for full-duplex, half-duplex, or simplex operation, and establishes checkpointing,
adjournment, termination, and restart procedures. The OSI model made this layer responsible
for graceful close of sessions, which is a property of the Transmission Control Protocol, and
also for session checkpointing and recovery, which is not usually used in the Internet Protocol
Suite. The session layer is commonly implemented explicitly in application environments that
use remote procedure calls.
Layer 6: Presentation Layer[edit]
The presentation layer establishes context between application-layer entities, in which the
application-layer entities may use different syntax and semantics if the presentation service
provides a big mapping between them. If a mapping is available, presentation service data
units are encapsulated into session protocol data units, and passed down the protocol stack.
This layer provides independence from data representation (e.g., encryption) by translating
between application and network formats. The presentation layer transforms data into the
form that the application accepts. This layer formats and encrypts data to be sent across a
network. It is sometimes called the syntax layer. [7]

The original presentation structure used the Basic Encoding Rules of Abstract Syntax Notation
One (ASN.1), with capabilities such as converting an EBCDIC-coded text fileto an ASCII-coded
file, or serialization of objects and other data structures from and to XML.
Layer 7: Application Layer[edit]
The application layer is the OSI layer closest to the end user, which means both the OSI
application layer and the user interact directly with the software application. This layer
interacts with software applications that implement a communicating component. Such
application programs fall outside the scope of the OSI model. Application-layer functions
typically include identifying communication partners, determining resource availability, and
synchronizing communication. When identifying communication partners, the application
layer determines the identity and availability of communication partners for an application
with data to transmit. When determining resource availability, the application layer must
decide whether sufficient network or the requested communication exists. In synchronizing
communication, all communication between applications requires cooperation that is
managed by the application layer. This layer supports application and end-user processes.
Communication partners are identified, quality of service is identified, user authentication and
privacy are considered, and any constraints on data syntax are identified. Everything at this
layer is application-specific.

You might also like