IP (Internet Protocol) Version 4 for CCNA R&S


what is basically loopback address. also why do we assign loopback ip to router which is not in range if we use it to check reachability of router.i m confuse

Loopback addresses are addresses that do not depend on the status of any particular interface to be reachable. This independence makes them very stable, and they are used primarily because of this stability. Here’s an example:

Let’s say you have a network with three routers - R1, R2, and R3, and they are all interconnected like a triangle. You have assigned a loopback of to R1 and advertised it via some routing protocol. Normally, R2 uses its direct connection with R1 to reach, but if this link goes down, it also has learned that is reachable via going through R3.

Now suppose that R1 is performing a service for the other two routers (it doesn’t matter what it is). So long as you tell the other routers to use to reach that service, it doesn’t matter if any one of the links in the triangle goes down. The traffic will simply route around the problem, and you didn’t have to reconfigure the service to use a different IP. This is what I mean by loopbacks are stable and independent of the details of the physical network “underneath” them.

Ok thanks Andrew. it was helpful


Sorry for my english, but I was Hoping that you will be able to understand me

if we can’t use the 1st and the last ip in subnet, why can I use /32 network for p2p via 2 routers?

Hi Mikhail,

Normally, the smallest subnet you can create is a /30 which has 4 IP addresses:

  • Network address
  • First host address
  • Last host address
  • Broadcast address

If you use this on a point-to-point link, we are “wasting” two IP addresses, the network and broadcast address. Because of this, some changes wered made which allows us to use a /31 mask on point-to-point links.

You can read the details in RFC 3021

A /32 mask refers to a single IP address, we use these on loopback interfaces.


Sorry, /31 in p2p I mean.

Thank You for the full and fast answer!

19 posts were merged into an existing topic: IP (Internet Protocol) Version 4 for CCNA R&S

This was a nice article. The only thing that is missing is you did not mentioned the number of addresses we can get in each class…

Hello Ali.

A class A address will have 8 bits for the network portion of the address and 24 bits for the host portion. Therefore the host portion can define up to 2^24 host addresses (minus two for the network and broadcast addresses). That’s 16,777,214 host addresses per network.

A class B address will have 16 bits for the network portion of the address and 16 bits for the host portion. Therefore the host portion can define up to 2^16 host addresses (minus two for the network and broadcast addresses). That’s 65,534 host addresses per network.

A class C address will have 24 bits for the network portion of the address and 8 bits for the host portion. Therefore the host portion can define up to 2^8 host addresses (minus two for the network and broadcast addresses). That’s 254 host addresses per network.

I hope this has been helpful!


1 Like

I have one query. Since IP is connectionless protocol, it needs UDP/TCP to ‘transport’ data. But with traffic generators (Ixia/Spirent), I can create an IP packet without any L4 protocol and able to send and receive the data. How might that be working?

Hello Rahul

You are correct that IP is a connectionless protocol. However the need to use TCP depends not on the connectionless nature of IP, but on the upper layer application being served. For web traffic, email or FTP for example, TCP (which creates sessions between hosts) must be used because the applications demand it.

Other applications do not require the connection-oriented nature of TCP such as Voice and Video, which use RTP, or DNS which uses UDP. These layer 4 protocols do not create sessions nor do they provide any reliability.

Some applications don’t even require a layer 4 structure at all. ICMP for example, which is what we use for ping does not have a layer 4 component. Routing protocols such as EIGRP, OSPF and RIP communicate and use only up to layer 3 encapsulation.

In the same way, traffic generators can generate traffic using only layer 3, as no session needs to be created.

Connection oriented protocols at layer 4 are used only if the upper layer applications it is supporting demand it.

I hope this has been helpful!



Hi Rene
As you mentioned that “Every packet is treated independently; there is no order in which the packets are arriving at their destination.” but when we see the IPv4 header , there is Fragment offset field, which identify the fragmented packet position in the original packet , so is this not a dependency of packets. Kindly clear little bit confuse here.Thanks

Hello Muhammad

This is an excellent question and it shows that you are thinking deeply about these concepts, and that’s great. So, the IP protocol is a connectionless protocol. This does indeed mean that each packet is treated independently. In other words, each packet is sent and forgotten. There is no mechanism that will check to see if IP packets have arrived safely, in order and in a timely manner. (this is taken care of at higher layers of the OSI model, like TCP and Application)

Now an IP packet can theoretically have a maximum size of just over 65000 bytes. However, an Ethernet Frame is typically restricted to a size of 1500 bytes. These numbers can be adjusted, but the point is that the size of the IP packet can be larger than the frame into which it is to be encapsulated. To deal with such cases, there is a mechanism called fragmentation. Fragmentation allows a single IP packet to be fragmented or broken into several pieces, each having its own IP header and each placed within a frame. When this occurs, there are several fields in the IP packet header that are used to keep track of such packet pieces. These include the More Fragments flag that indicate that the packet is indeed part of a larger fragmented packet as well as a fragment offset that helps to correctly put the fragments back together.

When these fragments reach their destination and deencapsulation takes place, they are put back together appropriately.

Now this does not change the fact that each individual IP packet is sent along its way on the network completely independently of any other. Each has its own header, its own source and destination IP and is at the mercy of the IP protocol. Because of this, fragmented packets may not arrive in order, but buffers at the destination keep fragments in memory until all arrive and can be reassembled and further deencapsulated. However, even fragmented packets can be lost, and if this happens, the received fragments of the incomplete packet are eventually discarded.

So fragmentation does involve some relationship between fragmented IP packets, but ultimately, each is sent on its own independently of any other.

I hope this has been helpful.



Why some places used routable IP for their internal infrastructure? for example 22.x.x.x or 100.x.x.x.x

Hello Francisco

In general, it is best practice not to use routable IP addresses on the internal infrastructure. However, it is possible to use these addresses internally. In many cases you can get away with it and it will work fine. However, if a host on the inside is trying to reach a routable IP address of a web server on the Internet, for example, but that IP address also exists on the inside of the network, such a request will go to the inside address and not to the web server on the Internet.

This is the primary reason for the segregation of IP addresses as routable and private.

I hope this has been helpful!



As you said , " Routing protocols such as EIGRP, OSPF and RIP communicate and use only up to layer 3 encapsulation." .

But in IP header it shows that protocol is OSPF , But in Layer 4 header u can see that there is a OSPF header it self , is not it a Layer-4 ??

Hello Narad

You could say that OSPF operates at Layer 4, since in Wireshark you can see that it is operating on top of Layer 3. However, when we refer to “Layer 4” we are referring specifically to the Transport Layer, where protocols such as TCP and UDP live, and where ports are used to separate sessions and to determine to which application each arriving segment belongs. In this sense, because there is no TCP or UDP applied at all, OSPF is not considered a Layer 4 protocol. It simply functions on top of IP.

I hope this has been helpful!


1 Like

Hi Rene ,
i have a question please , in order to find what exactly is the network address and the broadcast address all is needed is to changed to host bits to 1 or 0 , and that will give me the right addresses no matter which ip address i am trying to check?

also if its right is it the same with public addresses as well? do public addresses have a network and a broadcast address as well?

i am sorry for all the questions just trying to understand , thank you so much

Hello Vladimir

Yes, that is correct, no matter what IP address you are checking. This is the same for public or private addresses, the mechanisms are the same. Take a look at this NetworkLessons Note on IPv4 network and broadcast addresses for more detailed information.

I hope this has been helpful!


Hi Laz ,

thank you very much , that was very helpful.

1 Like