Hello friends, welcome to Gate Smashers. The topic is Network Layer. Network Layer is the third layer from below in the OSI Model. which takes data from Transport layer and passes on further to Data Link Layer. Now what are responsibilities or functionalities of Network Layer, this is what we have to disuss in this video. Means if I have source machine. All these layers are working in the source machine. But how is Network Layer helping in transfer of message in networking, what are its responsibilities and what are its functionalities, its roles, this is what we are going to disuss. The first and very important role is Host to Host delivery or we can also call it Source to Destination delivery. Source to Destination delivery. Host to Host delivery, Source to Destination delivery or it is also called Machine to Machine delivery. Machine to Machine delivery means from source machine to destination machine whose responsibility of transferring message is it? Network Layer. Let's understand with an example, here I take Network A, I have Network B. In network A and network B, let's say different topologies are used, here I use hub topology, here I use bus topology. Now what is the responsibility of Network Layer? How a machine in a different network can communicate with a machine in a different network. Means here is a machine let's say A2. A2 wants to communicate with B2. Now there won't be direct communication here. So direct communication won't happen between A2 and B2. Means they will have to send message through a channel, a media. So let's say this is the media. Now from A2 message will first reach R1, from R1 it will reach R2, and from R2 it will reach B2. So from A2 to R1, respoinsibility of transferring message is of Data Link Layer which we had discussed before, it works on node to node delivery. But here it's not node to node delivery. Here the work of source to destination delivery is of Network Layer. How it performs Host to Host delivery or Machine to Machine delivery? By using addresses, the addresses are known as Logical Address which we also call IP addresses. IP addressing. Very important point, that Host to Host delivery or Source to Destination delivery, how it performs? By using the Logical Address. Logical Address means, Logical Address or IP Address is basically a combination of 2 things, one is a Network ID and other is a Host ID. Means we know 2 things from 1 IP Address, that in IP address... in IP address Network and Host Host means machine from IP address I will know in which network to send the message and in that network there are many hosts, many machines, many servers. In that network, on which machine to send the message is the responsibility of IP Address And who uses this IP Address? Network layer uses to send the message. So that's why we call it Host to Host delivery. Means how is the message passed on in between that is the job of Data Link Layer. Network Layer's job is to transfer message from A2 to B2. How to transfer? By using IP addressing where A2 will give IP address of source and along with that it will put IP address of B2 in that message. Now how we find these IP addresses, how we use them, we will see in detail further the main important point here is Host to Host delivery is performed using IP address because from IP address I know which is the network and which is the host in the network. The other responsibility of Network Layer is routing. This is again a very important part. In routing... I'll first write the methods here, there is an RIP method, OSPF method these are different protocols, routing information protocol... These are the methods which are used to do the routing. Now there is different in RIP, we use Distance Vector Routing, or Link Straight Routing which are full fleged protocols. Protocols means what here? Protocols means set of instructions. Means the message going from source machine to destination machine will follow what instructions. And it is very important to follow protocol because all other people can use their own protocol. Means we will make our own protocols and deliver the message. But due to that message will not be delivered properly. So there should be a standard protocol so that source uses the same protocol, destination uses the same protocol, so that communication will be fast, it will be convenient, it will be efficient. Now what is the meaning of Routing? When message reaches R1 from A2, first the message comes to this router, then this router will decide, this router, this machine will decide how to route the place where message to be sent. Route means we have to decide the path here, it is possible that this router is connected further with different networks. Because this diagram that I have represented is of the internet. Internet means connection of different networks. So if these are all different types of networks, then router is not necessarily connected to only one or two networks, it can be connected to multiple networks. So this packet is to be sent on which router? Let's say it is to be sent on R2. How to decide this? By using routing. And we try to follow shortest path so that our message reaches destination soon. Here I am using the word router, I am using the word router because router is a device we use on the Network Layer. On Network Layer we use routers, on Network Layer we can also use bridges, on Network Layer we can also use switches, we can use firewalls also, but the most important devices used in the Network Layer are routers and switches. Means every router will definitely have these 3 layers. But in bridges basicaly there are 2 layers, Data Link Layer and Physical Layer. So in Data Link Layer we basically talk about which device? Bridges. Here we are talking about router. So routers are such intelligent devices that they can decide themselves. Means source sent message, source said let my message reach B2. It said let it reach from this route. But after that message will come to R1, so router has to decide what is the best route. Router has this intelligence. How? Because it has routing algorithms working. Why? Because Network Layer works on routers also, so router will decide what is the best path then R2 will decide what is the best path. That is called routing. This is the major responsibility of the Network Layer. So Host to Host delivery, routing, works on Logical Address. The next responsibility or role is Fragmentation. Fragmentation. Now what is Fragmentation? Whenever we send a packet, because the terminology we use on Network Layer is packet. Here we use packet switching. Means we also use switches in the Network Layer. Switches are also intelligent devies which basically help... If switches are not there, so through many wires... like in mesh topology we use many wires... means if we have multiple devices then to connect them I will have to use many wires. Switches make the wires less, so here we can also use switches. So when this packet goes from one place to another, there I may need fragmentation. Why is fragmentation needed? Let's say host sends a message to destination. But that message goes first to R1 router, now R1 router let's say it sends message to some other router. it sends message to some other router. Now that router may have its own capacity. Capacity means what size of packet it can accept. Like in CSMA/CD ethernet message of 1500 bytes maximum can be accepted. But if my message size is very big, means if my packet size is very big, then it can't accept Means intermediate node will not be able to accept the large packet which is not the... Its buffer size is less, packet size is larger. So what will router do? It will not send all the data at a time, it will divide the message into fragments. It will create multiple fragments according to its capacity and further pass on the data. So how fragmentation is performed that also we will see in details further. This is the major responsibility of Network Layer. There is 1 more responsibility although it is not used very much, Congestion Control. Congestion Control We talk about congestion in Network Layer but we basically use congestion on Transport layer, to control congestion. Congestion means it is possible that we filled the network completely. Means the capacity of the network, how many packets it can transfer further, if I fill the network completely with packets, means if all nodes at a time send infinite number of packets, then network will be filled with messages. That is called congestion situation. Now how to control this congestion? We handle congestion control less on Network Layer, we basically use on the Transport Layer. But still for congestion control we use Leaky Bucket method or Token Bucket method, these are different methods which control congestion. Or we use ICMP or IGMP protocols here. If a message is going and if a problem occurs in the message, then the router sends acknowledgement to the source that there is a problem in the message. Or if it is sending at very high speed, then they send it ICMP packet to reduce its speed of sending message. We will talk about ICMP, IGMP in further details. Here we are only discussing what are Network Layer's Responsibilities? What are its roles? So these are the major roles of the Network Layer in which most important is Host to Host delivery which is done by using the IP Address. So this is all about the Network Layer. Thank you.