Internetworking Basics

  •  

     Chapter 1: Introduction to Networking


    Binary and IP Addresses

    These notes guide you through understanding IP addresses and subnet masks.

    Introduction
    IP addresses
    Network Address and Host Address
    Boolean Logic
    Subnet Masks
    Summary

     
     

    Introduction

    IP addresses are 32 bit numbers assigned to computers, used for communication over the Internet. IP stands for "Internet Protocol."

    If you have a dial-up or similar connection to the Internet, you are automatically assigned an IP address by your ISP. This number can be different each time you connect, so the process is called "dynamically allocating" an IP address.

    If it is necessary for you to have the same IP address every time you connect to the internet, you may be assigned a static IP address. This is the opposite of a dynamic IP address and the same address will always be yours.

    On a LAN, it is the responsibility of the network administrators to assign IP addresses to devices on their network.

     

    IP Addresses

    IP addresses are 32 bit numbers, arranged in 4 groups of 8 each. Each group is separated by a dot. This is called the dotted-decimal notation. Here is an example.

    11000000.10100110.01110001.00001100

    This can be rewritten in decimal by converting each separate group to its decimal equivalent. I.e.

    192.168.113.12

    Without going into too many details, there are different classes of IP addresses available. Also there are public and private IP addresses. Public IP addresses are used on the Internet whereas private IP addresses may be used on LANs.

    Any IP address within the following two address ranges are classified as private IP addresses.

    10.0.0.0 to  10.255.255.255

    Two examples of private IP addresses within the range given above are shown below:-

    10.0.0.1

    10.100.30.6

    Another private IP address range is:-

    192.168.0.0 to  192.168.255.255

    Two examples of private IP addresses within the range given above are shown below:-

    192.168.0.1

    192.168.254.254

    There are different groups of public IP addresses too, but that's for another time.

    ~Now try the activity~

     Activity A

    1. Rewrite the following IP numbers in decimal

    1. 11111111.11111111.00000011.00000101
    2. 11111111.11111111.00001011.00000101
    3. 11111111.11111111.00010011.11111110
    4. 11111111.11111111.10101010.00000111

    2. Rewrite the following IP numbers in binary

    1. 10.0.0.4
    2. 10.255.255.64
    3. 192.168.0.0
    4. 192.168.255.1

    You can check your answers here

     

    Network Address and Host Address

    When an IP address is assigned to a computer, some of the bits on the left are used to designate the network address while the remaining bits on the right designate the actual host on that network. Every network must have an address just like a host on that network must have an address.

    To illustrate this, consider the following IP address.

    10.0.0.5

    The network address is 10.0.0.0

    While the host part of the address is 5

    Here is another example:-

    192.168.113.124

    The network address is 192.168.0.0

    While the host part of the address is 113.124

    To understand how an IP address can be split into a network part and a host part, you have to understand the concept of Boolean logic and subnet masks.

     

    Boolean Logic

    Boolean logic is based on binary logic, where you start with two inputs and end up with one output. Just like when you add two numbers together to make a combined single number.

    Imagine two inputs, both of which can be either 0 or 1.The state of the two inputs are compared and an output is produced, the value of which can also be either 0 or 1.

    The value of the output is dependent on which Boolean operation you perform on the two inputs. Operations that can be performed are AND, OR, NOT, NAND, NOR and XOR - exclusive OR.

    Boolean logic is actually based on logic gates. Logic gate are used in the construction of logic circuits and a logic gate accepts two incoming voltages and output a single voltage. 

    For the purpose of understanding IP address and subnet masks, the only logic operation you need to understand is the AND gate.
        

    AND GATE

    The AND gate produces a 1 only if both inputs are 1.  Otherwise a 0 is produced.

    Have a look at the four possible outputs you can have with two inputs...

    Here is part of a truth table for the AND gate:-

    x y Q = (x.y)
    0 0 0
    0 1   
    1 0  
    1 1  

    Would you like to fill in the rest using the diagrams for reference?
        

    OR GATE

    Just for the record, here is the OR gate:-

    The OR gate produces a 1 if at least one input is 1.  Otherwise a 0 is produced.

    Have a look...

    Here is part of a truth table for the OR gate:-

    x y Q = (x + y)
    0 0 0
    0
    1
      
    1 0  
    1 1  

    Would you like to fill in the rest using the diagrams for reference?

     

    NOT GATE

    Here is a NOT gate:-

    The NOT gate inverts an input so a 1 becomes a 0 and a 0 becomes a 1.

    Have a look...

    Here is the truth table for the NOT gate:-

    x Q = ( x )
    0 1
    1 0
     

    Subnet Mask

    Now, to refresh your memory, an IP address is composed of a network address part and a host address part. For a computer to know which is the network part and which is the host part, the subnet mask is needed.

    Lets consider the following IP address again:-

    10.0.0.5

    The network address is 10.0.0.0

    While the host address is 0.0.0.5

    This was worked out using the subnet mask of 255.255.255.0

    You will understand this when I perform a Boolean AND operation on the IP address using the subnet mask.

     

    ~~Example 1~~

     

    in decimal

    in binary

    IP address
    10.0.0.2
    00001010.00000000.00000000.00000010
    subnet mask 255.255.255.0 11111111.11111111.11111111.00000000
        AND
        
    00001010.00000000.00000000.00000000

    After the AND operation, we are left with the number :-

    00001010.00000000.00000000.00000000

    which in decimal is 10.0.0.0

    This number is the network address. This means the host part of address must be whatever is left from 10.0.0.2, i.e. the host part of the number is 2

     

    ~~Example 2~~

    Let's have another example.

    Suppose I have an IP address of 192.168.113.124 and a subnet mask of 255.255.0.0

     

    in decimal

    in binary

    IP address
    192.168.113.124
    11000000.10101000.01110001.01111100
    subnet mask 255.255.0.0 11111111.11111111.00000000.00000000
        AND
        
    11000000.10101000.00000000.00000000

    After the AND operation, we are left with the number :-

    11000000.10101000.00000000.00000000

    which in decimal is 192.168.0.0

    This number is the network address. This means the host part of address must be whatever is left from 192.168.113.124, i.e. the host part of the number is 113.124

     

    ~Now try the activity~

     Activity B

    1. Work out the network and host parts of the following IP addresses

    1. IP address 10.50.100.64, subnet mask 255.255.0.0
    2. IP address 10.0.0.20, subnet mask 255.255.255.0
    3. IP address 192.158.120.32, subnet mask 255.255.0.0

    You can check your answers here

     

    Summary

    On completing these notes you should have:-

    • Learnt that the IP addresses are 32-bit numbers used on the Internet
    • Learnt how to carry out simple Boolean operations
    • Practiced using subnet masks to determine the network and host parts of an IP address
     
     

    Site Home

    Top

    Unit Home


       


      

     

     

       
    This Unit 

    Unit Information

    Assessment

    Syllabus

    Scheme of Work

    Learning Resources

    Notes & Lessons

    Assignments

    Quizzes

    Activities

    Resources

    Books & Things

    Links