- Topics
- Network Infrastructure
- Security
- Collaboration, Voice and Video
- Wireless - Mobility
- Small Business Support Community
- International Zone
- Small Business FAQ
- OnPlus Service
- Small Business Security
- Small Business Surveillance
- Small Business Wireless
- Online Chat Support
- Small Business Online Device Emulators
- Non-Product Related Small Business Technical Questions
- Small Business Routers
- Small Business Support Service
- Jabber Video Support
- Small Business Voice and Conferencing
- Small Business Network and Smart Storage
- Small Business Smart Tips
- Small Business Switches
- WebEx Telepresence
- Voice Systems
- ATAs, Gateways and Accessories
- Small Business Support Community
- Regional Service & Support Options
- FindIT Network Management Discussions

- Data Center
- Service Providers
- Services
- Solutions and Architectures

- Experts
- Events
- Community

- Cisco Support Community
- :
- Network Infrastructure
- :
- WAN, Routing and Switching
- :
- given an ip v6 prefix, find the valid i...

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-28-2010
06:26 PM

08-28-2010
06:26 PM

Hi every body.

In ipv4 i used the following steps to find valid ip range, subnet,next subnet

Example:

10.10.10.0/24

subnet:

256-255=1

10.10.10.0 is the subnet

next subnet :

should be the multiple of 1

so 10.10.11.0 is next subnet after subnet 10.10.10.0

valid ip range:

10.10.10.1--10.10.10.254

=============================

Let say we have ipv6 prefix i.e 2001:0000::/23

our goal is to find valid ip address range, network number, next network number. Here i am stumped.

thanks and have a great weekend.

Solved! Go to Solution.

Labels:

2 ACCEPTED SOLUTIONS

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-29-2010
01:05 PM

08-29-2010
01:05 PM

Hello Sarah,

for IPv6 given the ultra big space no one cares of the number of hosts in a subnet.

The typical IPv6 subnet is an EUI-64 that has a 64 bit network portion and a 64 bit host portion.

Typical IPv6 prefix is a /48 that allows you to have 65535 /64 IPv6 subnets.

to be noted EUI-64 is taken from MAC address and 16 bits have a fixed value so in this case only 2^48 -2 are the possible hosts.

Hope to help

Giuseppe

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-30-2010
01:56 AM

08-30-2010
01:56 AM

Hello Sarah and Giuseppe,

Giuseppe is of course right. However, if taking this purely technically, a similar method (although not so straightforward) can be used to compute networks and their multiples in IPv6 addresses.

Let say we have ipv6 prefix i.e 2001:0000::/23

our goal is to find valid ip address range, network number, next network number. Here i am stumped.

Okay but let's take a more appropriate example, say: 2001:4118:ABCD::/46.

So the /46 prefix means that the "mask" (which is not used in this format in IPv6) is 16+16+8+6 bits long, translating into FFFF:FFFF:FFFC. How did I calculate that? Well, it is worth memorizing the following table of translation from decimal to hexadecimal mask byte:

Number of bits (CIDR) | Decimal value | Hexadecimal value |
---|---|---|

/0 | 0 | 0x0 |

/1 | 128 | 0x80 |

/2 | 192 | 0xC0 |

/3 | 224 | 0xE0 |

/4 | 240 | 0xF0 |

/5 | 248 | 0xF8 |

/6 | 252 | 0xFC |

/7 | 254 | 0xFE |

/8 | 255 | 0xFF |

Now note that each hexadecimal digit (0-9, A-F) is a direct expression of a 4-bit value. In hexadecimal notation, we can perform the binary AND on individual hexadecimal digits. Also note that for sake of easiness, we can translate each nibble to a value between 0 and 15 and compute the AND in decimal, then reconvert the result back to hexadecimal if that suits you better. Let's call this one hexadecimal digit (a group of 4 bits) a **nibble**.

So, to compute the address of the network, we have:

2001:4118:ABCD::

&&

FFFF:FFFF:FFFC::

The only "interesting" nibble here is the last one where the mask nibble is set to **C** (all other nibbles are uninteresting because any nibble bitwise ANDed with 0xF yields the same value again, and all other nibbles ANDed with 0 yield 0). All we have to do now is compute the binary AND of **0xD** in the address and of the **0xC** in the mask. Let's do it in decimal and in the very similar way to how we compute it for IPv4 addresses but here, we are in the scope of a single nibble so instead of subtracting the mask from 256, now we subtract the mask from 16:

0xD = 14 (nibble in the address)

0xC = 12 (nibble in the mask)

16 - 0xC = 16 - 12 = 4 - the networks are multiples of 4 on the interesting nibble

0xD = 14 rounded down to a multiple of 4 is 12 which is 0xC in hexadecimal

Thus, the network number in this case would be 2001:4118:ABCC::, and the next network would be 4 "steps" further at the **interesting nibble and above**: 2001:4118:ABC(C+4):: yielding 2001:4118:ABD0:: (note that 0xC + 4 = 0x10 so the predecessing nibble had to be incremented as well).

So the general process is:

- Translate the prefix length into a hexadecimal mask notation
- Find the (only) interesting nibble in mask whose value is neither
**0x0**nor**0xF** - Convert the interesting nibble from hexadecimal to decimal.
- In decimal, subtract the value of this interesting nibble from 16, and call this resulting difference M.
- Convert the corresponding nibble in the IPv6 address from hexadecimal to decimal. Let us call this value A.
- Round down the decimal value A to the nearest integer multiple of M, and convert it back to hexadecimal.

I guess that after a longer practice the converting between decimal and hexadecimal will not be necessary anymore. This can be computed directly in hexadecimal, however, a care must be then taken to not to mix decimal and hexadecimal notations.

Please ask further if there is anything unclear!

Best regards,

Peter

4 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-29-2010
01:05 PM

08-29-2010
01:05 PM

Hello Sarah,

for IPv6 given the ultra big space no one cares of the number of hosts in a subnet.

The typical IPv6 subnet is an EUI-64 that has a 64 bit network portion and a 64 bit host portion.

Typical IPv6 prefix is a /48 that allows you to have 65535 /64 IPv6 subnets.

to be noted EUI-64 is taken from MAC address and 16 bits have a fixed value so in this case only 2^48 -2 are the possible hosts.

Hope to help

Giuseppe

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-29-2010
02:13 PM

08-29-2010
02:13 PM

Thanks Giuseppe.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-30-2010
01:56 AM

08-30-2010
01:56 AM

Hello Sarah and Giuseppe,

Giuseppe is of course right. However, if taking this purely technically, a similar method (although not so straightforward) can be used to compute networks and their multiples in IPv6 addresses.

Let say we have ipv6 prefix i.e 2001:0000::/23

our goal is to find valid ip address range, network number, next network number. Here i am stumped.

Okay but let's take a more appropriate example, say: 2001:4118:ABCD::/46.

So the /46 prefix means that the "mask" (which is not used in this format in IPv6) is 16+16+8+6 bits long, translating into FFFF:FFFF:FFFC. How did I calculate that? Well, it is worth memorizing the following table of translation from decimal to hexadecimal mask byte:

Number of bits (CIDR) | Decimal value | Hexadecimal value |
---|---|---|

/0 | 0 | 0x0 |

/1 | 128 | 0x80 |

/2 | 192 | 0xC0 |

/3 | 224 | 0xE0 |

/4 | 240 | 0xF0 |

/5 | 248 | 0xF8 |

/6 | 252 | 0xFC |

/7 | 254 | 0xFE |

/8 | 255 | 0xFF |

Now note that each hexadecimal digit (0-9, A-F) is a direct expression of a 4-bit value. In hexadecimal notation, we can perform the binary AND on individual hexadecimal digits. Also note that for sake of easiness, we can translate each nibble to a value between 0 and 15 and compute the AND in decimal, then reconvert the result back to hexadecimal if that suits you better. Let's call this one hexadecimal digit (a group of 4 bits) a **nibble**.

So, to compute the address of the network, we have:

2001:4118:ABCD::

&&

FFFF:FFFF:FFFC::

The only "interesting" nibble here is the last one where the mask nibble is set to **C** (all other nibbles are uninteresting because any nibble bitwise ANDed with 0xF yields the same value again, and all other nibbles ANDed with 0 yield 0). All we have to do now is compute the binary AND of **0xD** in the address and of the **0xC** in the mask. Let's do it in decimal and in the very similar way to how we compute it for IPv4 addresses but here, we are in the scope of a single nibble so instead of subtracting the mask from 256, now we subtract the mask from 16:

0xD = 14 (nibble in the address)

0xC = 12 (nibble in the mask)

16 - 0xC = 16 - 12 = 4 - the networks are multiples of 4 on the interesting nibble

0xD = 14 rounded down to a multiple of 4 is 12 which is 0xC in hexadecimal

Thus, the network number in this case would be 2001:4118:ABCC::, and the next network would be 4 "steps" further at the **interesting nibble and above**: 2001:4118:ABC(C+4):: yielding 2001:4118:ABD0:: (note that 0xC + 4 = 0x10 so the predecessing nibble had to be incremented as well).

So the general process is:

- Translate the prefix length into a hexadecimal mask notation
- Find the (only) interesting nibble in mask whose value is neither
**0x0**nor**0xF** - Convert the interesting nibble from hexadecimal to decimal.
- In decimal, subtract the value of this interesting nibble from 16, and call this resulting difference M.
- Convert the corresponding nibble in the IPv6 address from hexadecimal to decimal. Let us call this value A.
- Round down the decimal value A to the nearest integer multiple of M, and convert it back to hexadecimal.

I guess that after a longer practice the converting between decimal and hexadecimal will not be necessary anymore. This can be computed directly in hexadecimal, however, a care must be then taken to not to mix decimal and hexadecimal notations.

Please ask further if there is anything unclear!

Best regards,

Peter

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-30-2010
08:05 AM

08-30-2010
08:05 AM

Thanks Peter. I am working on it.

Latest Documents

Created by Navanshu Sehgal
on 12-01-2017
02:47 PM

0

0

0

0

We are pleased to announce availability of Beta software for 16.6.3.
16.6.3 will be the second rebuild on the 16.6 release train targeted
towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are
looking for early feedback from customers befor...
view more

Created by hiarteag
on 11-30-2017
03:42 PM

0

0

0

0

Introduction Featured Speakers Luis Espejel is the Telecommunications
Manager of IENova, an Oil & Gas company. Currently he works with Cisco
IOS® and Cisco IOS XE platforms, and NX to some extent. He has also
worked as a Senior Engineer with the Routing P...
view more

Created by hiarteag
on 11-27-2017
05:30 PM

0

0

0

0

In this session you can learn more about Layer 3 multicast and the best
practices to identify possible threats and take security measures. It
provides an overview of basic multicast, the best security practices for
use of this technology, and recommendati...
view more

865

Views
0

Helpful
4

Replies
Popular Blogs

Created by ashirkar
on 10-01-2013
02:06 AM

7

74

7

74

Created by Akula Jyoti Lakshmi
on 08-09-2011
09:13 PM

15

43

15

43

Created by Sivagami Narayanan
on 10-28-2012
10:42 PM

1

39

1

39