protocols lesson

Upload: mapalista

Post on 02-Jun-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Protocols Lesson

    1/39

    Protocols, Lesson 2: Binary and the Internet Protocol

    To understand the Internet Protocol, we need to learn and understand Binary. An important part

    of IP is subnetting, which can only be explained and understood when an IP address is convertedto Binary. A lot of people are not aware that computers do not understand words, pictures and

    sounds when we interact with them by playing a game, reading or drawing something on the

    screen. The truth is that all computers can understand is zeros...

    and ones. What we see on the screen is just an interpretation of what the computer understands,

    so the information displayed is useful and meaningful to us.

    Binary: Bits and bytes

    To put it as simply as possible, a Bit is the smallest unit/value of Binary notation. The same way

    we say 1 cent is the smallest amount of money you can have, a Bit is the same thing but in

    Binary.

    A Bit can have only one value, either a one or a zero. So if I gave you a value of zero (0) then

    you would say that is one Bit. If I gave you two of them (00), you would say that 's two Bits.

    Now, if you had eight zeros or ones together, as in 0110 1010 (I put a space in between to make

    it easier for the eyes), you would say that's 8 Bits or one Byte. Yes, that is correct; eight Bits are

    equal to one Byte. It doesn't matter if they are all ones or zeros or a mixture of the two.

  • 8/10/2019 Protocols Lesson

    2/39

    The picture below gives you some examples:

    To sum this all up, 1024 Bytes equal 1 Kbytes (Kilobyte). Why 1024 and not 1000? Well it's

    because of the way Binary works. If you did the math, you would find the above correct.

    Everyone who uses the Internet would have, at one stage or another, come across the "Byte" or"Bit" term. This most frequently happens when you're downloading; you get the speed indicationin bytes or Kbytes per second. We are going to see exactly what a Bit, Byte and Kbyte is, so youunderstand the terms.

    So, what's binary got to do with IP?

    The above example shows an IP address in decimal notation, which we understand more easily.

    This IP address (192.168.0.1) is then converted to Binary, which is what the computer

    understands. You can see how big the number gets. It's easier for us to remember four different

    numbers than 32 zeros or ones.

  • 8/10/2019 Protocols Lesson

    3/39

    Pro+Features

    Enjoy the benefits of Pro+ membership, learn more and join.

    E-Zine

    What does WebRTC video mean for the network?

    Now, keeping in mind what we said earlier about Bits and Bytes, have you ever heard or read

    people saying that an IP address is a 32 Bit address? It is, and you can now see why:

    So to sum up all the above, we now know what Binary notation is, what a Bit, Byte and Kbyte is

    and how Binary relates to an IP address, which is usually represented in its decimal notation.

    Well, just as I explained in the introduction, computers display the zeros and ones in a way thatmakes the information useful to us. IP works a bit like this as well, where 98% of the time we seeit in a decimal notation, but the computer understands it in binary. The picture below gives youan example of how a computer understands an IP address:

    Understanding the conversion between decimal and binary

    The conversion is not that hard once you grasp the concept. The picture below shows an IP

    address that we are going to convert to Binary. Keep in mind that the method I'm going to show

    you is the same for all conversions. We are now going to convert the first octet in the IP address

    192.168.0.1 to Binary/ In other words, we take the "192" and convert it to Binary. We are not

    going to have to do any difficult calculations, just simple additions:

    http://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://users.techtarget.com/registration/searchNetworking/LoginRegister.page
  • 8/10/2019 Protocols Lesson

    4/39

    If you have read and understood the first section of this page, you should know that we need

    eight bits to create one octet or, if you like, the 192 number. Each bit takes a certain value which

    never changes, and this value is shown in purple, right above the bit. We then select the bits weneed in such a way that the sum of all selected bits gives us the decimal number we need.

    If you wanted to explain the conversion in mathematical terms, you would say that each bit is a

    power of 2 (2^), for example, bit 8 is actually '2^7' = 128 in decimal, bit 7 is '2^6 = 64 in

    decimal, bit 6 is '2^5' = 32 in decimal, bit 5 is '2^4' = 16 in decimal, bit 4 is '2^3' = 8 in decimal,

    bit 3 is '2^2' = 4 in decimal, bit 2 is '2^1' = 2 in decimal, and bit 1 is '2^0' = 1 in decimal.

    Note: When calculating the decimal value of an octet (192 in the example above), the Bitnumbers do NOT represent the power of two value we must use in order to get the decimal

    value. This means that Bit 1 does NOT translate to 2^1=1 in decimal.

    In our example, we used the 192. As you saw, we needed bits 8 and 7 and this gave us the Binary

    number of 11000000, which is 192 in decimal. You must remember that the values of each bit

    never change. For example, bit 8 always has a decimal value of 128, whereas bit 1 always takes

    the value of 1. Using this method, you will find it easy to convert decimal to Binary without the

    need for complex mathematical calculations.

  • 8/10/2019 Protocols Lesson

    5/39

    So let's have a look at the next octet, which is the decimal number 168:

    Here again you can see that we needed to choose bits 8, 6 and 4 (in other words put a "1" in the

    bit's position) in order to get a decimal value of 168. So the Binary value of 10101000 is equal tothe decimal value of 168.

    Let's now look at all 4 octets of our IP address, in Binary:

    No matter which way you convert, from Decimal to Binary or Binary to Decimal, the same

    method is used. If you understood the above, you should be able to convert any Binary or

    Decimal number.

  • 8/10/2019 Protocols Lesson

    6/39

    That just about does it for this section; you're now ready for the next section!

    Protocols, Lesson 3: The Internet Protocol header

    Introduction

    When a computer receives a packet from the network, the computer will first check the

    destination MAC address of the packet at the Datalink Layer (2). If it passes, it's then passed on

    to the Network layer.

    Sign in for existing members Continue Reading This Article

    Enjoy this article as well as all of our content, including E-Guides, news, tips and more.

    Continue Reading

    By submitting you agree to receive email communications from TechTarget and its

    partners. Privacy Policy Terms of Use .

    http://users.techtarget.com/registration/searchnetworking/LoginRegisterhttp://users.techtarget.com/registration/searchnetworking/LoginRegisterhttp://www.techtarget.com/html/privacy_policy.htmlhttp://www.techtarget.com/html/privacy_policy.htmlhttp://searchnetworking.techtarget.com/about/copyrighthttp://searchnetworking.techtarget.com/about/copyrighthttp://searchnetworking.techtarget.com/about/copyrighthttp://searchnetworking.techtarget.com/about/copyrighthttp://www.techtarget.com/html/privacy_policy.htmlhttp://users.techtarget.com/registration/searchnetworking/LoginRegister
  • 8/10/2019 Protocols Lesson

    7/39

    At the Network layer, it will check the packet to see if the destination IP address matches the

    computer's IP address. (If the packet is a broadcast, it will pass the network layer anyway.)

    From there, the packet is processed as required by the upper layers.

    On the other hand, the computer may be generating a packet to send to the network. Then, as the

    packet travels down the OSI model and reaches the Network layer, the destination and source IP

    address of this packet are added in the IP header.

    Just like every other protocol, IP has a place in the OSI model. Because it's such an important protocol and other protocols depend upon it, IP needs to be placed before them in the OSI model.That's why you will find it in Layer 3:

    The IP header

  • 8/10/2019 Protocols Lesson

    8/39

    It's worth noting that the 9th field, which is the "Protocol" field, contains some importantinformation that the computer uses to find out where it must pass the datagram once it strips off

    the IP header.

    Pro+Features

    Enjoy the benefits of Pro+ membership, learn more and join.

    E-Zine

    What does WebRTC video mean for the network?

    If you remember, TCP and UDP exist on Layer 4 of the OSI Model, which is the transport layer.

    When data arrives at a computer and the packet is processed by each layer, it needs to know

    whereabouts above to pass the data. This protocol field tells the computer to give the remaining

    data to either the TCP or UDP protocol, which is directly above it.

    http://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://users.techtarget.com/registration/searchNetworking/LoginRegister.page
  • 8/10/2019 Protocols Lesson

    9/39

    The destination IP address is another important field which contains the IP address of the

    destination machine.

    The next section talks about the five different classes of IP address

    Protocols, Lesson 4: Internet Protocol classes - Network and host ID

    Introduction

    Every protocol suite defines some type of addressing that identifies computers and networks. IP

    addresses are no exception to this rule. There are certain values that an IP address can take; these

    have been defined by the IEEE committee.

    Sign in for existing members Continue Reading This Article

    Enjoy this article as well as all of our content, including E-Guides, news, tips and more.

    Continue Reading

    By submitting you agree to receive email communications from TechTarget and its partners. Privacy Policy Terms of Use .

    A simple IP address is a lot more than just a number. It tells us the network of which the

    workstation is part and the node ID.

    IP address classes and structure

    When the IEEE committee sat down to sort out the range of numbers that were going to be used

    by all computers, they came up with five different ranges or, as we call them, "classes" of IP

    addresses. When someone applies for IP addresses they are given a certain range within a

    specific class depending on the size of their network. To keep things as simple as possible, let's

    first have a look at the five different classes:

    http://users.techtarget.com/registration/searchnetworking/LoginRegisterhttp://users.techtarget.com/registration/searchnetworking/LoginRegisterhttp://www.techtarget.com/html/privacy_policy.htmlhttp://www.techtarget.com/html/privacy_policy.htmlhttp://searchnetworking.techtarget.com/about/copyrighthttp://searchnetworking.techtarget.com/about/copyrighthttp://searchnetworking.techtarget.com/about/copyrighthttp://searchnetworking.techtarget.com/about/copyrighthttp://www.techtarget.com/html/privacy_policy.htmlhttp://users.techtarget.com/registration/searchnetworking/LoginRegister
  • 8/10/2019 Protocols Lesson

    10/39

    In the above table, you can see the five classes. Our first class is A and our last is E. The first

    three classes (A, B and C) are used to identify workstations, routers, switches and other devices,

    whereas the last two classes (D and E) are reserved for special use.

    Pro+Features

    Enjoy the benefits of Pro+ membership, learn more and join.

    E-Zine

    What does WebRTC video mean for the network?

    An IP address consists of 32 Bits, which means it's four Bytes long. The first octet (first eight

    bits or first byte) of an IP address is enough for us to determine the class to which it belongs.And, depending on the class to which the IP address belongs, we can determine which portion of

    the IP address is the network ID and which is the node ID.

    For example, if I told you that the first octet of an IP address is "168," then, using the above

    table, you would notice that it falls within the 128-191 range, which makes it a class B IP

    address.

    Understanding the classes

    We are now going to take a closer look at the five classes. Earlier I mentioned that companies are

    assigned different IP ranges within these classes, depending on the size of their network. For

    instance, if a company required 1000 IP addresses, it would probably be assigned a range that

    falls within a class B network rather than a class A or C.

    http://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://users.techtarget.com/registration/searchNetworking/LoginRegister.page
  • 8/10/2019 Protocols Lesson

    11/39

    The class A IP addresses were designed for large networks, class B for medium size networks

    and class C for smaller networks.

    Introducing network ID and node ID concepts

    We need to understand the network ID and node ID concept because it will help us to fully

    understand why classes exist. Putting it as simply as possible, an IP address gives us two pieces

    of valuable information:

    1) It tells us which network the device is part of (network ID).

    2) It identifies that unique device within the network (node ID).

    Think of the network ID as the suburb you live in and the node ID as your street in that suburb.

    You can tell exactly where someone is if you have their suburb and street name. In the same

    way, the network ID tells us to which network a particular computer belongs and the node ID

    identifies that computer from all the rest that reside in the same network.

    The picture below gives you a small example to help you understand the concept: Explanation:

  • 8/10/2019 Protocols Lesson

    12/39

    In the above picture, you can see a small network. We have assigned a class C IP range for this

    network. Remember that class C IP addresses are for small networks. Looking now at Host A,

    you will see that its IP address is 192.168.0.2. The network ID portion of this IP address is in

    blue, while the host ID is in orange.

    I suppose the next question someone would ask is: How do I figure out which portion of the IPaddress is the network ID and which is the host ID?

    That's what we are going to answer next.

    The network and node ID of each class

    The network class helps us determine how the four byte, or 32 bit, IP address is divided between

    network and node portions.

    The table below shows you (in binary) how the Network ID and Node ID changes depending on

    the class:

  • 8/10/2019 Protocols Lesson

    13/39

    Explanation:

    The table above might seem confusing at first but it's actually very simple. We will take class A

    as an example and analyze it so you can understand exactly what is happening here:

    Any class A network has a total of 7 bits for the Network ID (bit 8 is always set to 0) and 24 bits

    for the Host ID. Now all we need to do is calculate how much seven bits is:

    2 to the power of 7 = 128 networks and for the hosts : 2 to the power of 24 = 16,777,216 hosts in

    each network, of which two cannot be used because one is the Network Address and the other is

    the network broadcast address (see the table towards the end of this page). This is why when we

    calculate the "valid" hosts in a network we always subtract "2". So if I asked you how many

    "valid" hosts can you have a on class A network, you should answer 16,777,214 and NOT

    16,777,216.

    Below you can see all this in one picture:

  • 8/10/2019 Protocols Lesson

    14/39

    The same story applies for the other two classes we use, that's class B and class C, the only

    difference is that the number of networks and hosts changes because the bits assigned to them are

    different for each class.

    Class B networks have 14 bits for the network ID (Bits 15, 16 are set and can't be changed) and

    16 bits for the host ID, that means you can have up to '2 to the power of 14' = 16,384 networks

    and '2 to the power of 16' = 65,536 hosts in each network, of which two cannot be used because

    one is the network address and the other is the network broadcast address (see the table towardsthe end of this page). So if I asked you how many "valid" hosts can you have on class B network,

    you should answer 65,534 and NOT 65,536.

  • 8/10/2019 Protocols Lesson

    15/39

    Class C networks have 21 bits for the network ID (Bits 22, 23, 24 are set and can't be changed)

    and eight bits for the host ID, that means you can have up to '2 to the power of 21' = 2,097,152

    Networks and '2 to the power of 8' = 256 hosts in each network, of which two cannot be used

    because one is the network address and the other is the network broadcast address (see the table

    towards the end of this page). So if I asked you how many "valid" hosts you can have on class C

    network, you should answer 254 and NOT 256.

    Now, even though we have three classes of IP addresses that we can use, there are some IPaddresses that have been reserved for special use. This doesn't mean you can't assign them to a

    workstation but in the case that you did, it would create serious problems within your network.

    For this reason it's best to avoid using these IP addresses.

    The following table shows the IP addresses that you should avoid using:

    IP address Function

    Network 0.0.0.0 Refers to the default route. This route is to simplify routing tables

  • 8/10/2019 Protocols Lesson

    16/39

    used by IP.

    Network 127.0.0.0 Reserved for Loopback. The Address 127.0.0.1 is often used to

    refer to the local host. Using this Address, applications can address

    a local host as if it were a remote host.

    IP Address withall host bits set to

    "0" (Network

    Address) e.g.

    192.168.0.0

    Refers to the actual network itself. For example, network192.168.0.0 can be used to identify network 192.168. This type of

    notation is often used within routing tables.

    IP Address with all

    node bits set to "1"(Subnet / Network

    Broadcast) e.g.

    192.168.255.255

    IP Addresses with all node bits set to "1" are local network

    broadcast addresses and must NOT be used.

    Some examples: 125.255.255.255 (Class A), 190.30.255.255

    (Class B), 203.31.218.255 (Class C). See "Multicasts" &

    "Broadcasts" for more info.

    IP Address with all

    bits set to "1"

    (Network

    Broadcast) e.g.

    255.255.255.255

    The IP Address with all bits set to "1" is a broadcast address and

    must NOT be used. These are destined for all nodes on a network,

    no matter what IP address they might have.

    http://www.firewall.cx/multicast-intro.phphttp://www.firewall.cx/broadcast.phphttp://www.firewall.cx/broadcast.phphttp://www.firewall.cx/multicast-intro.php
  • 8/10/2019 Protocols Lesson

    17/39

    Now make sure you keep to the above guidelines because you're going to bump into a lot of

    problems if you don't!

    IMPORTANT NOTE: It is imperative that every network, regardless of Class and size, has a

    Network Address (first IP address e.g. 192.168.0.0 for Class C network) and a Broadcast

    Address (last IP address e.g. 192.168.0.255 for Class C network), as mentioned in the table and

    explanation diagrams above, which cannot be used.

    So when calculating available IP addresses in a network, always remember to subtract 2 fromthe number of IP addresses within that network.

    That all pretty much covers this section.

    Next, is the subnetting section, and before you proceed, make sure you're comfortable with the

    new concepts and material we have covered, otherwise subnetting will be very hard tounderstand.

    Protocols, Lesson 5: Introduction to subnetting

    What is subnetting?

    When we subnet a network, we basically split it into smaller networks. For example, when a set

    of IP addresses is given to a company, the company might want to "break" (the correct term is

    "partition") that one network into smaller ones, one for each department. This way, the technical

    department and management department can each have a small network of their own. By

    subnetting the network, we can partition it to as many smaller networks

  • 8/10/2019 Protocols Lesson

    18/39

    as we need. This also helps reduce traffic and hides the complexity of the network.

    By default, all type of classes (A, B and C) have a subnet mask; we call it the default subnet

    mask. You need to have one because:

    1) All computers need the subnet mask field filled when configuring IP

    2) You need to set some logical boundaries in your network

    3) You should at least enter the default subnet mask for the class you're using

    In the previous pages I spoke about IP classes, network IDs and host IDs. The subnet mask is

    what determines the network ID and host ID portion of an IP address.

    The table below shows clearly the subnet mask that applies for each network class.

    When dealing with subnet masks in the real world, we are free in most cases to use any type of

    subnet mask in order to meet our needs. If, for example, we require one network which can

    contain up to 254 computers, then a class C network with its default subnet mask will do fine. If

    we need more, then we might consider a class B network with its default subnet mask.

    Note that the default subnet masks have been set by the IEEE committee, the same guys that set

    and approve the different standards and protocols.

    We will have a closer look at this later on and see how we can achieve a class C network with

    more than 254 hosts.

    Understanding the concept

  • 8/10/2019 Protocols Lesson

    19/39

    Let's stop here for one moment and have a look at what I mean by partitioning one network into

    smaller ones by using different subnet masks.

    The picture below shows our example network (192.168.0.0). All computers here have been

    configured with the default class C subnet mask (255.255.255.0):

    Because of the subnet mask we used, all these computers are part of the one network marked in

    blue. This also means that any one of these hosts (computers, router and server) can

    communicate with each other.

    Pro+Features

    Enjoy the benefits of Pro+ membership, learn more and join.

    E-Zine

    What does WebRTC video mean for the network?

    http://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://users.techtarget.com/registration/searchNetworking/LoginRegister.page
  • 8/10/2019 Protocols Lesson

    20/39

    If we now wanted to partition this network into smaller segments, then we would need to change

    the subnet mask appropriately so we can get the desired result. Let's say we needed to change the

    subnet mask from 255.255.255.0 to 255.255.255.224 on each configured host.

    The picture below shows us how the computers will see the network once the subnet mask has

    changed:

    In reality, we have just created eight networks from the one large (blue) network we had, but I

    am keeping things simple for now and showing only two of these smaller networks because I

    want you to understand the concept of subnetting and see how important the subnet mask is.

    In the following pages we'll analyze in great depth the way subnetting works and how to

    calculate it. It is very important that you understand the concepts introduced in this section, so

    make sure you do, before continuing

  • 8/10/2019 Protocols Lesson

    21/39

  • 8/10/2019 Protocols Lesson

    22/39

    The effect of a subnet mask on an IP address

    In the IP classes page we analyzed and showed how an IP address consists of two parts, 1) The

    network ID and 2) The host ID. This rule applies for all IP addresses that use the default subnetmask, so we call them classful IP addresses.

    Pro+Features

    Enjoy the benefits of Pro+ membership, learn more and join.

    E-Handbook

    The cloud on the networking horizon

    E-ZineDiscover the next generation of mobile application performance management

    E-Handbook

    How to manage and monitor the converged network

    We can see this once again in the picture below, where the IP address is analyzed in binary,

    because this is the way you should work when dealing with subnet masks:

    http://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://searchnetworking.techtarget.com/ehandbook/The-cloud-on-the-networking-horizonhttp://searchnetworking.techtarget.com/ehandbook/The-cloud-on-the-networking-horizonhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/Discover-the-next-generation-of-mobile-application-performance-managementhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/Discover-the-next-generation-of-mobile-application-performance-managementhttp://searchnetworking.techtarget.com/ehandbook/How-to-manage-and-monitor-the-converged-networkhttp://searchnetworking.techtarget.com/ehandbook/How-to-manage-and-monitor-the-converged-networkhttp://searchnetworking.techtarget.com/ehandbook/How-to-manage-and-monitor-the-converged-networkhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/Discover-the-next-generation-of-mobile-application-performance-managementhttp://searchnetworking.techtarget.com/ehandbook/The-cloud-on-the-networking-horizonhttp://users.techtarget.com/registration/searchNetworking/LoginRegister.page
  • 8/10/2019 Protocols Lesson

    23/39

    We are looking at an IP address with its subnet mask for the first time. What we have done is

    take the decimal subnet mask and converted it to binary, along with the IP address. It is essential

    to work in binary because it makes things clearer and we can avoid making silly mistakes. The

    ones (1) in the subnet mask "lock" or, if you like, define the network ID portion. If we change

    any bit within the network ID of the IP address, then we immediately move to a different

    network. So in this example, we have a 24 bit subnet mask.

    NOTE:

    All class C classful IP addresses have a 24 bit subnet mask (255.255.255.0).

    All class B classful IP addresses have a 16 bit subnet mask (255.255.0.0).

    All class A classful IP addresses have an 8 bit subnet mask (255.0.0.0).

    On the other hand, the use of an IP address with a subnet mask other than the default results inthe standard host bits (the Bits used to identify the HOST ID) being divided in to two parts: a

    subnet ID and Host ID. These types of IP addresses are called classless IP addresses.

    In order to understand what a "classless IP address" is without getting confused, we are going to

    take the same IP address as above, and make it a classless IP address by changing the default

  • 8/10/2019 Protocols Lesson

    24/39

    subnet mask:

    Looking at the picture above you will now notice that we have a subnet ID, something that didn't

    exist before. As the picture explains, we have borrowed three bits from the host ID and used

    them to create a subnet ID. Effectively we partitioned our class C network into smaller networks.

    If you're wondering how many smaller networks, you'll find the answer on the next page. I prefer

    that you understanding everything here rather than blasting you with more subnet ID's, bits and

    all the rest :)

    Summary

    In this page we saw the default subnet mask of each class and also introduced the classful and

    classless IP addresses, which are a result of using various subnet masks.

    When we use IP addresses with their default subnet masks, e.g. 192.168.0.10 is a class C IP

    address so the default subnet mask would be 255.255.255.0, then these are "classful IP

    addresses."

    On the other hand, classless IP addresses have their subnet mask modified in a way so that there

    is a "subnet ID". This subnet ID is created by borrowing bits from the host ID portion.

  • 8/10/2019 Protocols Lesson

    25/39

    The picture below shows us both examples:

    I hope that you have understood the new concepts and material on this page. Next we are going

    to talk about subnet bits, learn how to calculate how many bits certain subnet masks are and see

    the different and most used subnet masks available

    Protocols, Lesson 8: Subnetting analysis

    We have already covered subnetting in some depth, but there is still much to learn. We are going

    to explain the available subnet masks and analyze a class C network using a specific subnetmask. It's all pretty simple, as long as you understand the logic behind it.

    Sign in for existing members Continue Reading This Article

    Enjoy this article as well as all of our content, including E-Guides, news, tips and more.

    Continue Reading By submitting you agree to receive email communications from TechTarget and its

    partners. Privacy Policy Terms of Use .

    Understanding and analyzing different subnet masks

    http://users.techtarget.com/registration/searchnetworking/LoginRegisterhttp://users.techtarget.com/registration/searchnetworking/LoginRegisterhttp://www.techtarget.com/html/privacy_policy.htmlhttp://www.techtarget.com/html/privacy_policy.htmlhttp://searchnetworking.techtarget.com/about/copyrighthttp://searchnetworking.techtarget.com/about/copyrighthttp://searchnetworking.techtarget.com/about/copyrighthttp://searchnetworking.techtarget.com/about/copyrighthttp://www.techtarget.com/html/privacy_policy.htmlhttp://users.techtarget.com/registration/searchnetworking/LoginRegister
  • 8/10/2019 Protocols Lesson

    26/39

    You cannot take any subnet mask you like and apply it to a computer or any other device,

    because depending on the random subnet mask you choose, it will either create a lot of routing

    and communication problems, or it won't be accepted at all by the device you're trying to

    configure.

    For this reason, we'll look at the various subnet masks so you know exactly what you need to

    use, and how to use it. Most important, we are going to make sure we understand WHY you need

    to choose specific subnet masks depending on your needs. Most people simply use a standard

    subnet mask without understanding what that does. This is not the case for the visitors to this

    site.

    Let's first have a look at the most common subnet masks, and then I'll show you where thenumbers come from:

    OK, so we know what a subnet mask is, but we haven't spoken (yet) about the different valuesthey take, and the guidelines we need when we use them. That's what we are going to do here.

    Common subnet masks

    Numer of bits Class A Class B Class C

    0 (default

    mask)

    255.0.0.0

    (default_mask)

    255.255.0.0

    (default_mask)

    255.255.255.0

    (default_mask)

    1 255.128.0.0

    (default+1)

    255.255.128.0

    (default+1)

    255.255.255.128(default+1)

  • 8/10/2019 Protocols Lesson

    27/39

    2 255.192.0.0

    (default+2)

    255.255.192.0

    (default+2)

    255.255.255.192(default+2)

    3 255.224.0.0

    (default+3)

    255.255.224.0

    (default+3)

    255.255.255.224(default+3)

    4 255.240.0.0

    (default+4)

    255.255.240.0

    (default+4)

    255.255.255.240(default+4)

    5 255.248.0.0

    (default+5)

    255.255.248.0

    (default+5)

    255.255.255.248(default+5)

    6 255.252.0.0

    (default+6)

    255.255.252.0

    (default+6)

    255.255.255.252(default+6)

    7 255.254.0.0

    (default+7)

    255.255.254.0

    (default+7)

    255.255.255.254(default+7)

    * Only 1 Host per subnet

    8 255.255.0.0

    (default+8)

    255.255.255.0

    (default+8)

    255.255.255.255(default+8)

    * Reserved for Broadcasts

    The above table might seem confusing at first, but don't despair! It's simple; really, you just need

    to look at it in a different way!

  • 8/10/2019 Protocols Lesson

    28/39

  • 8/10/2019 Protocols Lesson

    29/39

    Now, that was the easy part. The second part is slightly more complicated and I need you

    focused so you don't get mixed up!

    At first the diagram below seems quite complex, so try to follow me as we go through it:

    The IP address and subnet mask is show in binary format. We focus on the last octet which

    contains all the information we are after. Now, the last octet has two parts, the subnet ID and

    host ID. When we want to calculate the subnets and hosts, we deal with them one at a time. Once

    that's done, we put the subnet ID and host ID portion together so we can get the last octet's

    decimal number.

    We know we have eight networks (or subnets) and, by simply counting or incrementing our

    binary value by one each time, we get to see all the networks available. So we start off with 000

    and finish at 111. On the right hand side I have also put the equivalent decimal number for each

    network.

  • 8/10/2019 Protocols Lesson

    30/39

    Next we take the host ID portion, where the first available host is 0 0001 (1 in Decimal), because

    the 0 0000 (0 in Decimal) value is reserved as it is the network address (see IP classes page), and

    the last value which is 1 1111 (31 in decimal) is used as a broadcast address for each subnet (see

    Broadcast page).

    Note:

    I've given a formula in the IP classes page that allows you to calculate the available hosts, that's

    exactly what we are doing here for each subnet. This formula is :2 to the power of X -2. Where X

    is the number of bits we have in the host ID field, which for our example is 5. When we apply

    this formula, we get 2 to the power of 5 - 2 = 30 Valid (usable) IP addresses. If you're wondering

    why we subtract 2, it's because one is used for the Network Address of that subnet and the other

    for the Broadcast Address of that subnet. This shouldn't be new news to anyone :)

    Summing up, these are the ranges for each subnet in our new network:

  • 8/10/2019 Protocols Lesson

    31/39

    I hope the example didn't confuse you too much; the above example is one of the simplest type,

    which is why I chose a class C network, they are the easiest to work with.

    Protocols, Lesson 9: Subnet routing and communications

    Communication between subnets

    After reading all the previous pages about subnetting, let me ask you the following:

    Do you think computers that are on the same physical network but configured to be on separate

    subnets are able to communicate?

    The answer is "no". Why? Simply because you must keep in mind that we are talking about the

    communication between two different networks!

  • 8/10/2019 Protocols Lesson

    32/39

    Looking at our example of the class C network on the previous page, the fact is that one

    computer is part of the network 192.168.0.0 and the other one part of network 192.168.0.32, and

    these are two different networks. In our example, from the moment we modified the default

    subnet mask from 255.255.255.0 to 255.255.255.224, we split that one network to 8 smaller

    ones.

    Let's try it

    And because we just have to prove it, we are going to try it on my home network. In the worst

    case I'll have to spend all night trying to figure out what went wrong, but it will be worth it!

    Pro+Features

    Enjoy the benefits of Pro+ membership, learn more and join.

    E-Handbook

    The cloud on the networking horizon

    E-Zine

    Discover the next generation of mobile application performance management

    E-Handbook

    How to manage and monitor the converged network

    Without complicating things, here is a diagram of my home network. (I've excluded any

    computers we are not going to be using, in order to save space.)

    http://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://searchnetworking.techtarget.com/ehandbook/The-cloud-on-the-networking-horizonhttp://searchnetworking.techtarget.com/ehandbook/The-cloud-on-the-networking-horizonhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/Discover-the-next-generation-of-mobile-application-performance-managementhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/Discover-the-next-generation-of-mobile-application-performance-managementhttp://searchnetworking.techtarget.com/ehandbook/How-to-manage-and-monitor-the-converged-networkhttp://searchnetworking.techtarget.com/ehandbook/How-to-manage-and-monitor-the-converged-networkhttp://searchnetworking.techtarget.com/ehandbook/How-to-manage-and-monitor-the-converged-networkhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/Discover-the-next-generation-of-mobile-application-performance-managementhttp://searchnetworking.techtarget.com/ehandbook/The-cloud-on-the-networking-horizonhttp://users.techtarget.com/registration/searchNetworking/LoginRegister.page
  • 8/10/2019 Protocols Lesson

    33/39

    That's the network we have to play with. I have put on the diagram the results of a few simple

    pings from each host and, as you can see, they all came out nice: PASS.

    In order to proceed to phase two of our experiment, I modified the subnet mask of my

    workstation to 192.168.0.35 / 255.255.255.224 , my Slackware Linux Firewall to 192.168.0.1 /

    255.255.255.224 (internal Network Interface Card) and my NetWare 6 server to 192.168.0.10 /

    255.255.255.224 as shown in the diagram below:

  • 8/10/2019 Protocols Lesson

    34/39

  • 8/10/2019 Protocols Lesson

    35/39

  • 8/10/2019 Protocols Lesson

    36/39

    therefore can communicate with my workstation. On the other hand the NetWare server now acts

    as a gateway for network 1, so my workstation is reconfigured to use it as its gateway. Any

    packets from network 1 to network 2 or the Internet will pass through the NetWare server

    Method 2: Binding 2 IP addresses to the same network card

    This method is possibly the best and easiest way around our problem. We use the same network

    card on the NetWare server and bind another IP address to it.

    This second IP address will obviously fall within the network 1 IP range so that my workstation

    can communicate with the server:

    As noted on the diagram, the only problem we might encounter is the need for the operatingsystem of the server to support this type of configuration, but most modern operating systems

    would comply.

    Once configured, the server takes care of any routing between the two networks.

  • 8/10/2019 Protocols Lesson

    37/39

    Method 3: Installing a router

    The third method is to install a router in the network.

    This might seem a bit far fetched but remember that we are looking at all possible ways to

    establish communications between our networks! If this was a large network, then a router could

    possibly be the ideal solution, but given the size of my network, well... let's just say it would be a

    silly idea :)

    My workstation in this setup would forward all packets to its gateway, which is the router's

    interface and is connected to network 1 and it will be able to see all other servers and access the

    Internet. It's a similar setup to Method 1 but instead of a server we have a dedicated router. Oh,and by the way, if we would end up using such a configuration in real life.. the hub which both

    of the router's interfaces connects to would be replaced by some type of WAN link.

    That completes our discussion on Subnet routing and communication

  • 8/10/2019 Protocols Lesson

    38/39

    Protocols, Lesson 10: Subnetting guidelines

    The number of problems that can occur in a network are numerous, and -- believe it or not --

    most of them can be avoided if the initial design and installation of the network are done properly.

    Sign in for existing members Continue Reading This Article

    Enjoy this article as well as all of our content, including E-Guides, news, tips and more.

    Continue Reading

    By submitting you agree to receive email communications from TechTarget and its

    partners. Privacy Policy Terms of Use .

    When I say "done properly," I don't just mean connecting the correct wires into the wall sockets.

    Looking at it from an administrator's point of view, I'd say that a properly done job is one that

    has had a lot of thought put into it to avoid silly routing problems and meet today's and any

    future needs.

    This page contains all the information you need to know in order to design a network that won't

    suffer from any of the above problems. You would be amazed at how frequently I see networks

    suffering from all the above at large companies.

    Pro+Features

    Enjoy the benefits of Pro+ membership, learn more and join.

    E-Zine

    What does WebRTC video mean for the network?

    Guidelines - Plan for growth

    http://users.techtarget.com/registration/searchnetworking/LoginRegisterhttp://users.techtarget.com/registration/searchnetworking/LoginRegisterhttp://www.techtarget.com/html/privacy_policy.htmlhttp://www.techtarget.com/html/privacy_policy.htmlhttp://searchnetworking.techtarget.com/about/copyrighthttp://searchnetworking.techtarget.com/about/copyrighthttp://searchnetworking.techtarget.com/about/copyrighthttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://searchnetworking.techtarget.com/ezine/Network-Evolution/What-does-WebRTC-video-mean-for-the-networkhttp://users.techtarget.com/registration/searchNetworking/LoginRegister.pagehttp://searchnetworking.techtarget.com/about/copyrighthttp://www.techtarget.com/html/privacy_policy.htmlhttp://users.techtarget.com/registration/searchnetworking/LoginRegister
  • 8/10/2019 Protocols Lesson

    39/39

    Calculate the maximum number of subnets required by rounding up the maximum number to thenearest power of two. For example, if an organization needs five subnets, 2 to the power of 2 or 4will not provide enough subnet addressing space, so you must round up to 2 to the power of 3 =8 subnets.

    You must plan for future growth. For example, if 9 subnets are required today, and you choose to provide for 2 to the power of 4 = 16 subnets, this might not be enough when the seventeenthsubnet needs to be deployed. In this example, it might be wise to provide for more growth andselect 2 to the power of 5 = 32 as the maximum number of subnets.

    You must ensure that there are enough bits available to assign host addresses to theorganization's largest subnet. If the largest subnet needs to support 40 host addresses today, 2 tothe power of 5 = 32 will not provide enough host address space, so you would need to round upto 2 to the power of 6 = 64.

    Besides planning for additional subnets, you must also plan for more hosts to be added to eachsubnet in the future. Make sure the organization's address allocation provides enough bits todeploy the required subnet addressing plan.

    When developing subnets, class C addresses present the greatest challenge because fewer bits are

    available to divide between subnet addresses and host addresses. If you accommodate too many

    subnets, there may be no room for additional hosts and growth in the future.

    All the above points will help you succeed in creating a well designed network which will have

    the ability to cater for any additional future requirements.