Lecture 3.1 Network Layer

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 56

CSE2301 Data Communication and Computer Networks

Satheesh Abimannan, Ph.D., PDF (NTPU, Taiwan)


Professor & Deputy Director
CSE, ASET
Network Layer
What is a Network?

A network refers to two or more


connected computers that can share
resources such as data, a printer, an
Internet connection, applications, or a
combination of these resources.
Types of Network
OSI Layer Model
OSI Layer Model
Network Topologies: Bus Topology
Network Topologies: Star Topology

 A hub is a physical layer networking


device which is used to connect
multiple devices in a network. They
are generally used to connect
computers in a LAN.
 A hub has many ports in it. A
computer which intends to be
connected to the network is plugged
in to one of these ports. When a data
frame arrives at a port, it is broadcast
to every other port, without
considering whether it is destined for
a particular destination or not.
Network Topologies: Extended Star Topology
The OSI Model—
Why a Layered Network Model?

• Reduces complexity
• Standardizes interfaces
• Facilitates modular engineering
• Ensures interoperable technology
• Accelerates evolution
• Simplifies teaching and learning
The Seven Layers of the OSI Model

Binary Transmission:
Defines the electrical, mechanical, procedural, and
functional specifications for activating, maintaining,
and deactivating the physical link
Physical Media Types
Physical Media Types (Cont..)
Physical Media Comparison
Hub or Repeater

A hub (concentrator) is a device that


repeats the signals it receives on one
port to all other ports. It is a central
connection point for several network
devices.
Hub (Multiport Repeater)
Network Interface Card
 A network interface card (NIC) is a hardware component
without which a computer cannot be connected over a
network. It is a circuit board installed in a computer that
provides a dedicated network connection to the computer. It is
also called network interface controller, network adapter or
LAN adapter.
 NIC allows both wired and wireless communications.
 NIC allows communications between computers connected via
local area network (LAN) as well as communications over
large-scale network through Internet Protocol (IP).
 NIC is both a physical layer and a data link layer device, i.e. it
provides the necessary hardware circuitry so that the physical
layer processes and some data link layer processes can run on
it.
WAN—Physical Layer Implementations

• Physical layer implementations vary


• Cable specifications define speed of link
Data Link Layer
Data Link Layer

Data Link layer protocols create, transmit, and


receive packets. This layer is also responsible for
logical MAC addressing and LLC (Logical Link
Control) processing, creating logical
topologies,and controlling media access.
Data Link Layer

MAC Address

The network interface card


address, called the hardware
address, is protocol-independent
and is usually assigned at the 00-0C-F1-5E-BE-F2
factory. This address is
technically called the media
access control address (MAC)
because it is found on the MAC MAC Address = Hardware Address
sub layer of the Data Link layer.
Data Link Layer

Data Link Devices

The Data Link layer is manipulated by two


devices: bridges and switches. These are more
Bridges Switches complex and more expensive than their Physical
layer counterparts, but they do have advantages.
Data Link Layer

Switch

When a switch receives data the switch


examines the data link header for the
MAC address of the destination station
and forwards it to the correct port. This
opens a path between ports that can use the
full bandwidth of the topology.
Data Link Layer

 Data link layer performs the most reliable node to node delivery of data.
 It forms frames from the packets that are received from network layer and gives it to
physical layer.
 It also synchronizes the information which is to be transmitted over the data.
 Error controlling is easily done.
 The encoded data are then passed to physical.
Data Link Layer
Data Link Layer

 Data: PDU of Application, Presentation and Session Layers


 Segment: PDU of Transport Layer
 Packet: PDU of network Layer
 Frame: PDU of data-link Layer
 Bit: PDU of physical Layer
Data Link Layer

 A frame is a unit of communication in the data link layer.


 Data link layer takes the packets from the Network Layer and
encapsulates them into frames.
 If the frame size becomes too large, then the packet may be divided into
small sized frames.
 At receiver’ end, data link layer picks up signals from hardware and
assembles them into frames.
Fields of a Data Link Layer Frame

 Frame Header: It contains the source and the destination addresses of the frame
and the control bytes.
 Payload field: It contains the message to be delivered.
 Trailer: It contains the error detection and error correction bits. It is also called a
Frame Check Sequence (FCS).
 Flag: Two flag at the two ends mark the beginning and the end of the frame.
Fields of a Data Link Layer Frame

Frame Header

A frame header contains the destination address, the source address and three
control fields kind, seq, and ack serving the following purposes:
 kind: This field states whether the frame is a data frame or it is
used for control functions like error and flow control or link
management etc.
 seq: This contains the sequence number of the frame for
rearrangement of out – of – sequence frames and sending
acknowledgments by the receiver.
 ack: This contains the acknowledgment number of some frame,
particularly when piggybacking is used.
Fields of a Data Link Layer Frame

Point – to – Point Protocol

 Flag: It is of 1 byte that with bit pattern 01111110.


 Address: 1 byte which is set to 11111111 in case of the broadcast.
 Control: 1 byte set to a constant value of 11000000.
 Protocol: 1 or 2 bytes that define the type of data contained in the payload field.
Fields of a Data Link Layer Frame

Point – to – Point Protocol

 Payload: This carries the data from the network layer. The maximum
length of the payload field is 1500 bytes.
 FCS: It is a 2 byte or 4 bytes frame check sequence for error detection.
The standard code used is CRC (cyclic redundancy code).
Fields of a Data Link Layer Frame

High-level Data Link Control (HDLC)

 High-level Data Link Control (HDLC) is a group of communication protocols of


the data link layer for transmitting data between network points or nodes. The fields
of an HDLC frame are:
Fields of a Data Link Layer Frame

High-level Data Link Control (HDLC)

 Flag: It is an 8-bit sequence with bit pattern 01111110.


 Address: It contains the address of the receiver. The address field may be from
1 byte to several bytes.
 Control: It is 1 or 2 bytes containing flow and error control information.
 Payload: This carries the data from the network layer. Its length may vary from
one network to another.
 FCS: It is a 2 byte or 4 bytes frame check sequence for error detection. The
standard code used is CRC (cyclic redundancy code)
Network Layer
Network Layer

The network layer provides connectivity and path


selection between two host systems that may be
located on geographically separated networks
Network Layer

IP is a standard that defines the manner in which the network layers of two
hosts interact. IP addresses are 32 bit long, hierarchical addressing scheme.

192.168.6.17

IP Address = Logical Address


Network Layer Devices

The devices that operate at the Network layer are routers and Layer 3 Switches.

Router
Layer 3 Switch
Routers

Routers facilitate communication within this internet work. It decides how to send
packets within the network so that they arrive at their destination.
Layer 3 Switches

The Layer 3 switch functions at the


Network layer and performs the
multiport, virtual LAN, data pipelining
functions of a standard Layer 2 switch. It
can also perform basic routing functions
between virtual LANs.
Previous Layers

 The purpose of the physical layer is to transport a raw bit stream


from one machine to another.
 The main task of the data link layer is to transform a raw
transmission facility into a line that appears free of undetected
transmission errors to the network layer.
Network Layer

 This layer is concerned with getting packets from the source all
the way to the destination.
 Getting to the destination may require making many hops at
intermediate routers along the way.
 Thus, the network layer is the lowest layer that deals with end-to-
end transmission
 To achieve its goals, the network layer must know about the
topology of the communication subset (i.e., the set of all routers)
and choose appropriate paths through it.
Network Layer

 It must also take care to choose routes to avoid overloading some


of the communication lines and routers while leaving others idle
 Finally, when the source and destination are in different networks,
new problems occur. It is up to the network layer to deal with
them.
 In this session we will study all these issues and illustrate them,
primarily using the Internet and its network layer protocol, IP,
although wireless networks will also be addressed
Network Layer – Design Issues

1. Store-and-Forward Packet Switching


2. Services Provided to the Transport Layer
3. Implementation of Connectionless Service
4. Implementation of Connection-Oriented Service
5. Comparison of Virtual-Circuit and Datagram Subnets
Network Layer – Design Issues

1. Store-and-Forward Packet Switching

Figure 1. The environment of the network layer protocols


Network Layer – Design Issues

1. Store-and-Forward Packet Switching

 A host with a packet to send transmits it to the nearest router, either on its
own LAN or over a point-to-point link to the carrier
 The packet is stored there until it has fully arrived so the checksum can be
verified.
 Then it is forwarded to the next router along the path until it reaches the
destination host, where it is delivered
 This mechanism is store-and-forward packet switching
 Store − and forward packet switching ensures high quality data packet
transmission. Since erroneous packets are discarded at each router, bad
packets or invalid packets in the network are mostly eliminated.
Network Layer – Design Issues

1. Store-and-Forward Packet Switching

 However, error − free packet transmission is achieved by compromising on


the overall speed of transmission. Switch latency is introduced due to
waiting for entire packet to arrive as well as computation of CRC. Though
the latency at each router may seem small enough, the cumulative latency at
all routers make it inappropriate for time − critical online applications.
Network Layer – Design Issues
2. Services Provided to the Transport Layer
 The network layer provides services to the transport layer at the network
layer/transport layer interface
 An important question is what kind of services the network layer provides to
the transport layer
 The network layer services have been designed with the following goals in
mind.
a. The services should be independent of the router technology.
b. The transport layer should be shielded from the number, type, and
topology of the routers present.
c. The network addresses made available to
d. the transport layer should use a uniform numbering plan, even
across LANs and WANs.
Network Layer – Design Issues
2. Services Provided to the Transport Layer
 The discussion centers on whether the network layer should provide connection
oriented service or connectionless service.
 Internet community’s opinion: the routers’ job is moving packets around and
nothing else. The subnet is inherently unreliable. Therefore, the hosts should
accept the fact that the network is unreliable and do error control and flow
control themselves.
 This viewpoint leads quickly to the conclusion that the network service should
be connectionless, with primitives SEND PACKET and RECEIVE PACKET.
 Furthermore, each packet must carry the full destination address, because each
packet sent is carried independently of its predecessors, if any.
Network Layer – Design Issues
2. Services Provided to the Transport Layer
 Telephone companies’ opinion: the subnet should provide a reliable,
connection oriented service.
 In this view, quality of service is the dominant factor, and without connections in
the subnet, quality of service is very difficult to achieve, especially for real-time
traffic such as voice and video.
 The Internet offers connectionless network layer service
 ATM networks offer connection-oriented network-layer service.
 However, it is interesting to note that as quality-of-service guarantees are
becoming more and more important, the Internet is evolving.
Network Layer – Design Issues
2. Services Provided to the Transport Layer
 Telephone companies’ opinion: the subnet should provide a reliable,
connection oriented service.
 In this view, quality of service is the dominant factor, and without connections in
the subnet, quality of service is very difficult to achieve, especially for real-time
traffic such as voice and video.
 The Internet offers connectionless network layer service
 ATM networks offer connection-oriented network-layer service.
 However, it is interesting to note that as quality-of-service guarantees are
becoming more and more important, the Internet is evolving.
Network Layer – Design Issues
3. Implementation of Connectionless Service

 If connectionless service is offered, packets are injected into the subnet


individually and routed independently of each other
 In this context, the packets are frequently called datagrams and the subnet is
called a datagram subnet
Network Layer – Design Issues
3. Implementation of Connectionless Service

Figure. Routing within a datagram subnet


Network Layer – Design Issues
3. Implementation of Connectionless Service

 Router: When a packet comes into a router, the frame header and trailer
are stripped off and the packet located in the frame’s payload field is
passed to the routing software. This software uses the packet header to
choose an output line.
 Each router has an internal table telling it where to send packets for each
possible destination.
 The algorithm that manages the tables and makes the routing decisions is
called the routing algorithm.
Network Layer – Design Issues
4. Implementation of Connection-oriented Service

 If connection-oriented service is used, a path from the source router to the


destination router must be established before any data packets can be
sent.
 This connection is called a VC (virtual circuit), in analogy with the
physical circuits set up by the telephone system, and the subnet is called a
virtual-circuit subnet.
 When a connection is established, a route from the source machine to the
destination machine is chosen as part of the connection setup and stored
in tables inside the routers.
 When the connection is released, the virtual circuit is also terminated.
Network Layer – Design Issues
4. Implementation of Connection-oriented Service
 With connection-oriented service, each packet carries an identifier telling
which virtual circuit it belongs to.

Figure. Routing within a virtual-circuit subnet


References

https://www.cisco.com/c/en_in/products/switches/what-is-a-wan-wide-area-netwo
rk.html#~what-it-is
https://www.youtube.com/watch?v=LANW3m7UgWs
https://www.youtube.com/watch?v=-6Uoku-M6oY

You might also like