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

(Hussein Samir) #16

Thank you

(Mohammad Hasanuz Zaman) #17

Hi Rene,

What about the Range 0.0.0.0 ~0.255.255.255/8 ?? Please give a short defination of CIDR and VLSM . Is both are some ??

br//
zaman

(Rene Molenaar) #18

Hi Zaman,

0.0.0.0/8 - Addresses in this block refer to source hosts on “this” network. Address 0.0.0.0/32 may be used as a source address for this host on this network; the addresses within 0.0.0.0/8 may be used to refer to specified hosts on this network ([RFC1122], Section 3.2.1.3).

VLSM = Variable Length Subnet Mask. This means we let go of the class A/B/C subnet masks and use whatever masks we want to use.

The CIDR notation means we write down subnet masks like /24 instead of 255.255.255.0.

Rene

(Fernando F) #19

Hi Rene,

Actually I have a MAC OS and I don’t know why but only the loopback address 127.0.0.1 successful respond to a ping command. 127.0.0.2 for instance I got error message.

Thanks,
Best regards,
Fernando

(Rene Molenaar) #20

Hi Fernando,

I’m not a MAC user but it seems that by default, only 127.0.0.1 is used as a loopback address on MAC OS.

Take a look at this post on Stack Overflow, they explain how to enable the entire range:

Rene

(apurva p) #21

hi,

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

(Andrew P) #22

Apurva,
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 1.1.1.1/32 to R1 and advertised it via some routing protocol. Normally, R2 uses its direct connection with R1 to reach 1.1.1.1, but if this link goes down, it also has learned that 1.1.1.1 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 1.1.1.1 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.

(apurva p) #23

Ok thanks Andrew. it was helpful

(Mikhail K) #24

Hello!

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

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

(Rene Molenaar) #25

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.

Rene

(Mikhail K) #26

Sorry, /31 in p2p I mean.

Thank You for the full and fast answer!

(Shantel - Networklessons.com) split this topic #27

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

(ALI S) #28

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…

(Lazaros Agapides) #29

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!

Laz

(Rahul A) #30

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?

(Lazaros Agapides) #31

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!

Laz

1 Like
(Muhammad A) #32

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

(Lazaros Agapides) #33

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.

Laz

3 Likes
(Francisco R) #34

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

(Lazaros Agapides) #35

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!

Laz

1 Like