Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CN BCA6005 - Module - V - Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

BCA 6th Semester


Subject: BCA 6005 Computer Networks

Module V: Network Layer

· The Network Layer is the third layer of the OSI model.


· It receives the services from transport layer and forwards the service request to the data link layer.
· The network layer translates the logical addresses into physical addresses.
· It determines the route from the source to the destination and also manages the traffic problems
such as switching, routing and congestion control of data packets.
· The network layer is responsible for delivery of the packets from sending host to the receiving
host.

The functions of the network layer can be categorized as:

1. Routing: It is a process used to identify the optimal root between sending host and the receiving
host.
2. Logical Addressing: The data link layer uses the physical address and network layer uses the
logical address. The logical addressing is required to distinguish between source and destination
system. The network layer adds a header to the packet which includes the logical addresses of
both the sender and the receiver.
3. Internetworking: This is the main role of the network layer that it provides the logical
connection between different types of networks.
4. Fragmentation: The fragmentation is a process of breaking the packets into the smallest
individual data units that travel through different networks.

5.1 Routing:
Routing is a process which is performed by network layer devices (Routers) in order to deliver the
packets by finding an optimal path from one network to another. To forward incoming data packets,
a router learns all available routes in the network and stores them in a table known as the routing table.
Requirements of routing include:

· Optimality
· Efficiency
· Stability
· Robustness

BCA6005 Computer Network, Module V Page 1


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

· Simplicity
· Accuracy
· Fairness

Example of Routing:

Notes:

- A router uses routing table and routing algorithm to perform routing.


- The routing algorithm is that part of the network layer software responsible for deciding which
output line an incoming packet should be transmitted on.

Types of Routing

Routing can be classified into three categories:

· Nonadaptive Routing
· Adaptive Routing
· Default Routing

Nonadaptive Routing: Nonadaptive routing techniques do not base their routing decisions on
measurements or estimates of the current traffic and topology. It is also known as Static Routing. The
key features of this type of routing technique are:

BCA6005 Computer Network, Module V Page 2


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

- The network administrator manually adds the routes in a routing table.


- A Router can send the packets for the destination along the route defined by the network
administrator.
- The routing decisions are not made based on the condition or topology of the networks.
- It has no overhead on the CPU usage of the router. Therefore, the cheaper router can be used to
obtain static routing.
- It is secure as the system administrator is allowed only to have control over the routing to a
particular network.
- It is not suitable for a large network as it becomes a very difficult task to add each route manually
to the routing table.

Example :

Dynamic Routing: Adaptive Routings also known as Dynamic Routings, change their routing decisions
to reflect changes in the topology, and usually the traffic as well. The key features of this routing
technique are:

- The router adds a new route in the routing table for each packet in response to the changes in the
condition or topology of the network.
- Dynamic protocols are used to discover the new routes to reach the destination.
- In Dynamic Routing, RIP and OSPF are the protocols used to discover the new routes.
- On failure of a route, an alternative route is automatically identified to reach the destination.

BCA6005 Computer Network, Module V Page 3


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

- All the routers must have the same dynamic routing protocol in order to exchange the routes.
- If the router discovers any change in the condition or topology, then router broadcast this
information to all other routers.
- It is more expensive in terms of CPU and bandwidth usage.
- It is less secure as compared to default and static routing.

Example:

Default Routing: Default Routing is a technique in which a router is configured to send all the packets to
the same hop device, and it doesn't matter whether it belongs to a particular network or not. A Packet is
transmitted to the device for which it is configured in default routing. The key features of this routing
technique are:

- It is used when networks deal with the single exit point.


- It is also useful when the bulk of transmission networks have to transmit the data to the same hop
device.
- When a specific route is mentioned in the routing table, the router will choose the specific route
rather than the default route. The default route is chosen only when a specific route is not
mentioned in the routing table.

5.2 Congestion Control:

Congestion: A state occurring in network layer when the message traffic is so heavy that it slows down
network response time. Congestion degrades the performance of the network as it increases transmission
time. Networks use congestion control and congestion avoidance techniques in order to avoid the collapse
of the network due to congestion.

BCA6005 Computer Network, Module V Page 4


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

Congestion Control: Congestion control modulates traffic entry into a communication network in order
to avoid congestive collapse resulting from oversubscription. This is typically accomplished by reducing
the rate of packets. Whereas congestion control prevents senders from overwhelming the network, flow
control prevents the sender from overwhelming the receiver.

Techniques: The congestion control techniques are used to control or prevent congestion. The
techniques can be broadly classified into two categories:

1. Open loop congestion control.


2. Closed loop congestion control.

Open loop congestion control: Open loop congestion control techniques are applied to prevent
congestion before it happens. The congestion control is handled either by the source or the destination.
The Policies adopted by open loop congestion control are:

· Retransmission Policy: It is the policy in which retransmission of the packets are taken
care. If the sender feels that a sent packet is lost or corrupted, the packet needs to be
retransmitted. This transmission may increase the congestion in the network.
To prevent congestion, retransmission timers must be designed to prevent congestion and
also able to optimize efficiency .
· Window Policy: Selective repeat window should be adopted as it sends the specific
packet that may have been lost.
· Discarding Policy: A good discarding policy adopted by the routers is that the routers
may prevent congestion and at the same time partially discards the corrupted or less
sensitive package and also able to maintain the quality of a message.
· Acknowledgment Policy: Several approaches can be used to prevent congestion related
to acknowledgment such as the receiver should send acknowledgement for N packets
rather than sending acknowledgement for a single packet or the receiver should send an
acknowledgment only if it has to send a packet or a timer expires.
· Policy Admission: In admission policy a mechanism should be used to prevent
congestion. Switches in a flow should first check the resource requirement of a network
flow before transmitting it further. If there is a chance of congestion or there is
congestion in the network, router should deny establishing a virtual network connection
to prevent further congestion.
Closed Loop Congestion Control: This technique is used to treat or alleviate congestion, after it
happens. Several approaches are used by different protocols; some of them are:
· Backpressure: It is a technique in which the congested node stops receiving packet from
upstream node. This may cause the upstream node or nodes to become congested and
rejects receiving data from above nodes. Backpressure is a node-to-node congestion
control technique that propagates in the opposite direction of data flow. The backpressure

BCA6005 Computer Network, Module V Page 5


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

technique can be applied only to virtual circuit where each node has information of its
above upstream nod

· Choke Packet Technique: A choke packet is a packet sent by a node to the source to
inform it of congestion. Each router monitors its resources and the utilization at each of
its output lines. Whenever the resource utilization exceeds the threshold value which is
set by the administrator, the router directly sends a choke packet to the source giving it a
feedback to reduce the traffic. The intermediate nodes through which the packets have
traveled are not warned about congestion .

5.3 Internetworking Principles:

Internetworking: Internetworking is the process or technique of connecting different networks by using


intermediary devices such as routers or gateway devices. The Internet is the largest pool of networks
geographically located throughout the world but these networks are interconnected using the same
protocol stack, TCP/IP. Internetworking is only possible when all the connected networks use the same
protocol stack or communication methodologies.

Example:

BCA6005 Computer Network, Module V Page 6


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

Requirements for Internetworking: The overall requirements for an internetworking facility are:

- Provide a link between networks. At minimum, a physical and link control connection is needed.
- Provide for the routing and delivery of data between processes on different networks.
- Provide an accounting service that keeps track of the use of the various networks and routers and
maintains status information.
- Provide the services just listed without requiring modifications to the networking architecture of
constituent networks. This means accommodating the following differences:

1. Different addressing schemes.


2. Different maximum packet size.
3. Different network access mechanisms.
4. Different timeouts.
5. Different error recovery services.
6. Different status reporting.
7. Different routing techniques.
8. Different user access control: authorization for use of the network.
9. Connection-oriented vs. connectionless.

Motivation for Internetworking:

- Sharing of computer resources across a number of communications networks

BCA6005 Computer Network, Module V Page 7


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

- The use of multiple networks allows for network isolation when needed. This is critical to
network performance as failure is contained within one network. Also, a network can be shielded
from intrusion (Security).
- Contain the amount of traffic sent between the networks (e.g., Routing domains)
- Network Management that provides centralized support and troubleshooting capabilities in an
internetwork.

Components of an Internetwork:

- Campus Network: locally connected users in a building or group of buildings. It generally uses
LAN technologies.
- Wide Area Networks (WANs): distant campuses connected together usually through connection
providers such as a telephone company.
- Remote connections: linking branch offices and mobile users to a corporate campus. They are
generally dial-up links or low bandwidth dedicated WAN links.

Routing domains: A routing domain is an administrative entity. Its goal is to establish boundaries for the
dissemination of routing information.

- It is also useful for security administration.


- Provides accounting, billing, and revenue services (i.e., Accounting Management).
- Overcome the “flat network” problem by providing a routing hierarchy.

5.4 Internet Protocol:

The Internet Protocol (IP) is the set of rules or protocol by which data is sent from one computer to
another on the Internet. Each computer (known as a host) on the Internet has at least one logical address
called IP address that uniquely identifies it from all other computers on the Internet. It is connectionless
and unreliable protocol. It does not ensure guaranteed and successfully delivery of packet. In order to
make it reliable, it must be paired with reliable protocol such as TCP at the transport layer. There two
version of internet protocol, IPv4 and IPv6.

IPv4: Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). It is one of the
core protocols of standards-based internetworking methods in the Internet and other packet-switched
networks. IPv4 uses 32-bit (4 byte) addressing, which gives 2 32 addresses. It transmits the data in form of
a packet called datagram.

BCA6005 Computer Network, Module V Page 8


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

Format of an IPv4 packet:

|ß----Header ---------à|ß----------------------------------Payload-----------------------------------------------à|

|ß------------------------------20 to 65,536 bytes-----------------------------------------à|

Notes:

· The length of datagram is variable.


· The Datagram is divided into two parts: header and Payload.
· The length of header is 20 to 60 bytes.
· The header contains information for routing and delivery of the packet.

Format of IPv4 Header:

VERSION (4-Bit): It defines the Version of the IP, which is 4 for IPv4

HLEN (4-Bit): This field defines IP header length (4 bits), which is the number of 32 bit words in the
header. The minimum value for this field is 5 and the maximum is 15.

BCA6005 Computer Network, Module V Page 9


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

Type of service (8-Bit): It defines the type of services: Low Delay, High Throughput, Reliability.

Total Length (16-Bit): This field indicates the total length of IP datagram (Length of header + Data),
which has a minimum value 20 bytes and the maximum is 65,535 bytes.

Identification (16-Bit): Unique Packet Id for identifying the group of fragments of a single IP datagram.

Flags (3-Bit): 3 flags each of 1 bit: reserved bit (must be zero), do not fragment flag, more fragments flag
(same

Fragment Offset(13-Bit): Represents the number of Data Bytes ahead of the particular fragment in the
particular Datagram. It is specified in terms of number of 8 bytes, which has the maximum value of
65,528 bytes.

Time to live: Datagram’s lifetime (8 bits),It prevents the datagram to loop through the network by
restricting the number.

Protocol (8-Bit): Name of the protocol to which the data is to be passed.

Header Checksum (16-Bit): 16 bits header checksum for checking errors in the datagram header.

5.5 Address Resolution Protocol (ARP):

The address resolution protocol (ARP) is a protocol used by the Internet Protocol (IP) [RFC826],
specifically IPv4, to map IP network addresses to the hardware addresses used by a data link protocol.
The protocol operates below the network layer as a part of the interface between the OSI network and OSI
link layer. It is used when IPv4 is used over Ethernet. The term address resolution refers to the process of
finding an address of a computer in a network. The address is "resolved" using a protocol in which a piece
of information is sent by a client process executing on the local computer to a server process executing on
a remote computer. The information received by the server allows the server to uniquely identify the
network system for which the address was required and therefore to provide the required address. The
address resolution procedure is completed when the client receives a response from the server containing
the required address.

An Ethernet network uses two hardware addresses which identify the source and destination of each
frame sent by the Ethernet. The destination address (all 1's) may also identify a broadcast packet (to be
sent to all connected computers). The hardware address is also known as the Medium Access Control
(MAC) address, in reference to the standards which define Ethernet. Each computer network interface
card is allocated a globally unique 6 byte link address when the factory manufactures the card (stored in a
PROM). This is the normal link source address used by an interface. A computer sends all packets which
it creates with its own hardware source link address, and receives all packets which match the same
hardware address in the destination field or one (or more) pre-selected broadcast/multicast addresses.

The Ethernet address is a link layer address and is dependent on the interface card which is used. IP
operates at the network layer and is not concerned with the link addresses of individual nodes which are
to be used. The address resolution protocol (ARP) is therefore used to translate between the two types of

BCA6005 Computer Network, Module V Page 10


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

address. The ARP client and server processes operate on all computers using IP over Ethernet. The
processes are normally implemented as part of the software driver that drives the network interface card.

There are four types of ARP messages that may be sent by the ARP protocol. These are identified by four
values in the "operation" field of an ARP message. The types of message are:

1. ARP-Request (Broadcast, source IP address of the requester)


2. ARP-Reply (Unicast to requester, the target)

The format of an ARP message:

5.6 Point-to-Point Protocol:


Point - to - Point Protocol (PPP) is a communication protocol of the data link layer that is used to transmit
multiprotocol data between two directly connected (point-to-point) computers. It is a byte - oriented
protocol that is widely used in broadband communications having heavy loads and high speeds. Since it is
a data link layer protocol, data is transmitted in frames.

The main services provided by Point - to - Point Protocol:


· Defining the frame format of the data to be transmitted.
· Defining the procedure of establishing link between two points and exchange of data.
· Stating the method of encapsulation of network layer data in the frame.
· Stating authentication rules of the communicating devices.
· Providing address for network communication.
· Providing connections over multiple links.

Components of PPP:
· Encapsulation Component − It encapsulates the datagram so that it can be transmitted over the
specified physical layer.

BCA6005 Computer Network, Module V Page 11


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

· Link Control Protocol (LCP) : It is responsible for establishing, configuring, testing,


maintaining and terminating links for transmission. It also imparts negotiation for set up of
options and use of features by the two endpoints of the links.
· Authentication Protocols (AP): These protocols authenticate endpoints for use of services. The
two authentication protocols of PPP are:
1. Password Authentication Protocol (PAP)
2. Challenge Handshake Authentication Protocol (CHAP)
· Network Control Protocols (NCPs): These protocols are used for negotiating the parameters
and facilities for the network layer. For every higher-layer protocol supported by PPP, one NCP
is there.

5.7 Telnet:
It is an application protocol used on the Internet or local area network to provide a bidirectional
interactive text-oriented communication facility using a virtual terminal connection. User data is
interspersed in-band with Telnet control information in an 8-bit byte oriented data connection over
the Transmission Control Protocol (TCP). Telnet enables a user to manage an account or device remotely.
For example, a user may telnet into a computer that hosts their website to manage his or her files
remotely. To use telnet, you must have a software (Telnet client) installed. On a remote device, a Telnet
server must be installed and running. Consider the following example:

The network administrator wants to use his computer (Host A) to access and manage the router (R1). The
administrator will start a Telnet client program on Host A and enter the IP address of the router R1 (telnet
10.0.0.1):

BCA6005 Computer Network, Module V Page 12


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

The administrator can now manage the remote device (R1) from his own computer.

5.8 File Transfer Protocol (FTP):


File Transfer Protocol (FTP) is the standard mechanism provided by TCP/IP for copying a file from one
host to another. Although transferring files from one system to another seems simple and straightforward,
but some of the problems associated are:
• Two systems may use different file name conventions. Two systems may have different ways to
represent text and data.
• Two systems may have different directory structures.
All these problems have been solved by FTP in a very simple and elegant approach. FTP differs from
other client/server applications in that it establishes two connections between the hosts. One connection is
used for data transfer, the other for control information (commands and responses). Separation of
commands and data transfer makes FTP more efficient. The control connection uses very simple rules of
communication. FTP uses two well-known TCP ports: Port 21 is used for the control connection, and port
20 is used for the data connection.
FTP uses the services of TCP. It needs two TCP connections. The well-known port 21 is used for the
control connection and the well-known port 20 for the data connection

Components of FTP:
• The Client Components:
1. User interface
2. Client control process
3. The client data transfer process.
• The Server Components:
1. The server control process
2. The server data transfer process.

BCA6005 Computer Network, Module V Page 13


Birla Institute of Technology Mesra Off-Campus Lalpur, Ranchi 834001

- The control connection is made between the control processes. The data connection is
made between the data transfer processes.
- The control connection remains connected during the entire interactive FTP session.
- The data connection is opened and then closed for each file transferred. It opens each
time commands that involve transferring files are used, and it closes when the file is
transferred.

Assignments:

1. What do you mean by NFS and how do you configure it on Linux? Briefly explain about the
procedure.
2. Briefly explain about the HTTP, SMTP and SNMP.

BCA6005 Computer Network, Module V Page 14

You might also like