You are on page 1of 65

EEE 51101 -

Computers
Networks

Lecture
3
Topics
 Network Devices
 What is an IP address ?
 Types of IP addressing
 Classes of IP address
 Private IP Addresses
 Network Addresses
 Introduction to Sub-networks

EEE51101 – Computers Networks 2 2020/2021


Switches
Definition:
 A switch is a small hardware device that joins
multiple computers together within one local
area network, technically switch operates at
layer 2 (Date link layer) of the OSI model.

EEE51101 – Computers Networks 3 2020/2021


Switches

1
3
Host A Host D
5
Switch
4

3
3

Host B
Host C
EEE51101 – Computers Networks 4 2020/2021
How LAN switches work?
1. Node A sends data to host B.
2. The switch gets the first packet of data from node A. The
switch reads the MAC address and saves the address to the
lookup table. The switch now knows where to find Node A
whenever a packet with this address arrives. This process is
called learning.
Mac address Port No
0000.74a3.0023 1

Example of the lookup table (Mac address table)


3. Since the switch does not know where node B is, the switch
sends the packet to all the ports. But the switch does not send
the packet to the port on which the packet arrived. When a
switch sends a packet out to all ports to find a specific node,
this is flooding.

EEE51101 – Computers Networks 5 2020/2021


4. Node B gets the packet and sends a packet back to node
A in acknowledgement.
5. The packet from node B arrives at the switch. Now the
switch can add the MAC address of node B to the lookup.
Since the switch already knows the address of node A,
the switch sends the packet directly to the node. This
action is called forwarding.
6. The next packet from node A to node B arrives at the
switch. The switch now has the address of node B, too,
so the switch forwards the packet directly to node B.
7. The switch continues to learn and flood as it adds nodes
to the lookup tables.
EEE51101 – Computers Networks 6 2020/2021
Hubs
 Hubs enable computers on a network to
communicate. Each computer plugs into the
hub with a cable, and information sent from one
computer to another passes through the hub.
 A hub can’t identify the source or intended
destination of the information it receives, so it
sends the information to all of the computers
connected to it, including the one that sent it.
 A hub can send or receive information, but it
can’t do both at the same time (half duplex).
This makes hubs slower than switches.
EEE51101 – Computers Networks 7 2020/2021
Repeaters
 Length of cable used influence the quality of
communication.
 Attenuation increases with distance.
 An electrical signal in a cable gets weaker the
further it travels, due to energy dissipated in
cable.
 In long cable runs, repeaters are used to
periodically regenerate and strengthen the
signal. i.e. they boost signals.
 Advantage: Makes it easy to expand a network
over a large distance.
EEE51101 – Computers Networks 8 2020/2021
Repeaters

EEE51101 – Computers Networks 9 2020/2021


Routers

 A router is a device that interconnects two


or more computer networks, and
selectively interchanges packets of data
between them.

EEE51101 – Computers Networks 10 2020/2021


Routers

 Each data packet contains address information


that a router can use to determine if the source
and destination are on the same network, or if
the data packet must be transferred from one
network to another.
 Where multiple routers are used in a large
collection of interconnected networks, the
routers exchange information about target
system addresses, so that each router can build
up a table showing the preferred paths between
any two systems on the interconnected networks.
EEE51101 – Computers Networks 11 2020/2021
Topics
 Network Devices
 What is an IP address ?
 Types of IP addressing
 Classes of IP address
 Private IP Addresses
 Network Addresses
 Introduction to Sub-networks

EEE51101 – Computers Networks 12 2020/2021


What You Will Need
 Pen or pencil and multiple sheets of paper

 An open mind….

 Be willing to practice on your own…if you


don’t use it, you WILL lose it

EEE51101 – Computers Networks 13 2020/2021


What is an IP address
 An IP address is 32 bits long—4 separate bytes (8 bits = 1
byte)
 An IP Address is represented in dotted-decimal notation
 Each byte represents a decimal number separated by a
period
 Example: 10.100.30.4
 Each byte has a total of 256 values—0-255
 The first byte may be the most important to you right
now…

EEE51101 – Computers Networks 14 2020/2021


What is an IP address

 Binary format:
27 26 2 5 2 4 23 2 2 21 20
 To represent 4 in binary =
00000100
 IP Address: 7.4.3.2 =
in binary: 00000111.00000100.00000011.00000010

EEE51101 – Computers Networks 15 2020/2021


Topics
 Network Devices
 What is an IP address ?
 Types of IP addressing
 Classes of IP address
 Private IP Addresses
 Network Addresses
 Introduction to Sub-networks

EEE51101 – Computers Networks 16 2020/2021


Types of IP address
 Static IP address
 manually input by network administrator
 manageable for small networks
 requires careful checks to avoid duplication
 Dynamic IP address
 assigned by server (DHCP  Dynamic Host
Configuration Protocol) when host boots
 Given automatically from a range of
addresses

EEE51101 – Computers Networks 17 2020/2021


Topics
 Network Devices
 What is an IP address ?
 Types of IP addressing
 Classes of IP address
 Private IP Addresses
 Network Addresses
 Introduction to Sub-networks

EEE51101 – Computers Networks 18 2020/2021


Classes of IP address
 There are three (3) usable IP address classes—A,
B and C
 Class A - large organizations
 Class B - medium sized organizations
 Class C - small organizations
 Two other unused classes: Class D & Class E are
reserved.
 The first byte identifies the class “Classification”

EEE51101 – Computers Networks 19 2020/2021


Classes of IP address

EEE51101 – Computers Networks 20 2020/2021


Practice:
Practice: Classification—What Class?
Classification—What Class?

EEE51101 – Computers Networks 21 2020/2021


 Each IP Address has two parts:

EEE51101 – Computers Networks 22 2020/2021


Subnet Mask
 Identifies the division of the Network and the
Host portion of an IP Address
 The default mask is the number of bits that are
reserved by the address class—Default Line
position
- Class A: 255.0.0.0
- Class B: 255.255.0.0
- Class C: 255.255.255.0

EEE51101 – Computers Networks 23 2020/2021


Subnet Mask
 A custom Subnet Mask can be defined by
an Administrator to accommodate many
network subnets ----- (by moving the line)

EEE51101 – Computers Networks 24 2020/2021


Topics
 Network Devices
 What is an IP address ?
 Types of IP addressing
 Classes of IP address
 Private IP Addresses
 Network Addresses
 Introduction to Sub-networks

EEE51101 – Computers Networks 25 2020/2021


Private IP addresses
 These addresses can be used on a private
network, but they are not routable through the
internet.
 If every host on every network had to have real
routable IP addresses, we would have run out of
IP addresses to hand out years ago.

EEE51101 – Computers Networks 26 2020/2021


Topics
 Network Devices
 What is an IP address ?
 Types of IP addressing
 Classes of IP address
 Private IP Addresses
 Network Addresses
 Introduction to Sub-networks

EEE51101 – Computers Networks 27 2020/2021


Network vs. Host
 Every IP address has 2 parts:
 1 identifying the network it resides on
 1 identifying the host, or node, address on
the network
 The class of the address and the subnet
mask determine which part belongs to the
network address and which part belongs to
the host address.

EEE51101 – Computers Networks 28 2020/2021


IP Address Breakdown
 The class of the address determines, by
default, which part is for the network (N)
and which part belongs to the node (n)
Class A: NNNNNNNN.nnnnnnnn.nnnnnnnn.nnnnnnnn
Class B: NNNNNNNN.NNNNNNNN.nnnnnnnn.nnnnnnnn
Class C: NNNNNNNN.NNNNNNNN.NNNNNNNN.nnnnnnnn

EEE51101 – Computers Networks 29 2020/2021


140.179.220.200
 Our example is a Class B address
 By default, the Network part of the address
is defined by the first 2 octets: 140.179.x.x
 By default, the node part of the address is
defined by the last 2 octets: x.x.220.200

*Note that the network part of the address


is also known as the Network Address

EEE51101 – Computers Networks 30 2020/2021


Example
 Class C: 192.168.200.0
 Number of hosts = 256 -2 = 254
 Hosts: 192.168.200.1 , 192.168.200.2 up to
192.168.200.254
 Another example: class C: 196.1.1.0
 Different network but same class
 Hosts: 196.1.1.1 , 196.1.1.2 up to 196.1.1.254

EEE51101 – Computers Networks 31 2020/2021


Two Reserved Addresses on a Subnet

 In order to specify the Network Address of


a given IP address, the node portion is set
to all “0”s:
 140.179.0.0
 If all the bits in the node portion are set to
“1”s, then this specifies the broadcast
address that is sent to all nodes on the
network:
 140.179.255.255

EEE51101 – Computers Networks 32 2020/2021


Broadcasting and Unicasting
In computer networking, unicast
transmission is the sending of messages
to a single network destination
identified by a unique address
In computing, broadcasting
refers to a method of
transferring a message to all
recipients simultaneously

EEE51101 – Computers Networks 33 2020/2021


Topics
 Network Devices
 What is an IP address ?
 Types of IP addressing
 Classes of IP address
 Private IP Addresses
 Network Addresses
 Introduction to Sub-networks

EEE51101 – Computers Networks 34 2020/2021


Introduction to Sub-networks
 Why Subnet a Network?
 Allows Additional Networks (subnets)
without applying for additional IPs
 Gives local administrators more control: it is
easier to identify network problems in a
group of smaller networks
 Reduced n/w traffic: reduces the Size of
Broadcast Domains

EEE51101 – Computers Networks 35 2020/2021


Subnet Mask
 Subnet masks are applied to an IP address
to identify the Network portion and the
node portion of the address.
 Your computer performs a bitwise logical
AND operation between the address and
the subnet mask in order to find the
Network Address or number.
 Confused? Continue!

EEE51101 – Computers Networks 36 2020/2021


Default Subnet Masks
Class A - 255.0.0.0
11111111.00000000.00000000.00000000
Class B - 255.255.0.0
11111111.11111111.00000000.00000000
Class C - 255.255.255.0
11111111.11111111.11111111.00000000

EEE51101 – Computers Networks 37 2020/2021


Logical Bitwise AND Operation
 Example:
 140.179.240.200
 It’s a Class B, so the subnet mask is:
 255.255.0.0

We need to look at this as our computer


does so we can perform the bitwise AND...

EEE51101 – Computers Networks 38 2020/2021


Logical Bitwise AND Operation
140.179.220.200 Class B address
255.255.0.0 Subnet Mask

In Binary:
10001100.10110011.11110000.11001000
11111111.11111111.00000000.00000000
10001100.10110011.00000000.00000000
By doing this, the computer has found that
our Network Address is 140.179.0.0
EEE51101 – Computers Networks 39 2020/2021
Another Example:
Suppose we have the address of:
206.15.143.89? What class is it?
Class C
What is the subnet mask?
255.255.255.0
What is the Network Address?
206.15.143.0

What is the host portion of the address?


0.0.0.89
EEE51101 – Computers Networks 40 2020/2021
Why Do We Care!?
 You can manipulate your subnet mask in
order to create more network addresses.
Why?
 If you have a Class C network, how many
individual node addresses can you have?
 1 to 254
 Remember, you can’t have all “0”s and all “1”s in
the node portion of the address.
 So we cannot use 206.25.143.0 (all “0”s) or
206.25.143.255 (all “1”s) as a node address.

EEE51101 – Computers Networks 41 2020/2021


Why Do We Care!?
 So we have 1 Class C Network (206.15.143.0)
 And we have 254 node address (1 to 254)
 But what if our LAN has 5 networks in it and each
network has no more than 30 nodes on it?
 Do we apply for 4 more Class C licenses, so we
have one for each network?
 We would be wasting 224 addresses on each
network, a total of 1120 addresses!

EEE51101 – Computers Networks 42 2020/2021


Subnetting
 Subnetting is a way of taking an existing
class licence and breaking it down to create
more Network Addresses.
 This will always reduce the number of
node addresses for a given network.
 Subnetting makes more efficient use of the
address or addresses assigned to you.

EEE51101 – Computers Networks 43 2020/2021


So How Does This Work?
 We ask our ISP for a Class C license.
 They give us the Class C bank of
206.15.143.0
 This gives us 1 Network (206.15.143.0)
with the potential for 254 node addresses
(206.15.143.1 to 206.15.143.254).
 But we have a LAN made up of 5 Networks
with the largest one serving 25 nodes.
 So we need to Subnet our 1 IP address...
EEE51101 – Computers Networks 44 2020/2021
So How Does This Work?
 To calculate the number of subnets
(networks) and/or nodes, we need to do
some math:

EEE51101 – Computers Networks 45 2020/2021


How Do You Create Subnets?
 Bits are Borrowed from the Host Field
 This Creates a Subnet Field in the IP address

EEE51101 – Computers Networks 46 2020/2021


Class C Subnets
Network Network Network Host

S S H H H H H H

 Two Bits Borrowed from the Host Field to form a third layer
of hierarchy - A Subnet Field
 Two Bits must always remain so a maximum of 6 Bits may
be borrowed from a Class C network
 How many bits can be borrowed from a Class B network?
From a Class A network?
EEE51101 – Computers Networks 47
47 2020/2021
Class C Subnets
Network Network Network Host

S S H H H H H H

The number of Subnets Created is calculated


using the following formula:

# Subnets Created = 2# Borrowed Bits


EEE51101 – Computers Networks 48 2020/2021
Class C Subnets
S S H H H H H H

Borrow 2 Bits = 22 = 4 Subnets


S S S H H H H H

Borrow 3 Bits = 23 = 8 Subnets


S S S S H H H H

Borrow 4 Bits = 24 = 16 Subnets


EEE51101 – Computers Networks 49 2020/2021
Class C Subnets
S S S S S H H H

Borrow 5 Bits = 25 = 32 Subnets


S S S S S S H H

Borrow 6 Bits = 26 = 64 Subnets


Borrow 7 Bits = Cannot
Two Host Bits Must Remain
EEE51101 – Computers Networks 50 2020/2021
How Many Subnets?
Borrowed
Class Bits #Subnets
A,B,C 2 4
A,B,C 3 8
A,B,C 4 16
A,B,C 5 32
A,B,C 6 64
A,B 7 128
A,B 8 256
A,B 9 512
A,B 10 1,024
A,B 11 2,048
A,B 12 4,096
A,B 13 8,192
A,B 14 16,384
A 15 32,768
A 16 65,536
A 17 131,072
A 18 262,144
A 19 524,288
A 20 1,048,576
A 21 2,097,152
A 22 4,194,304
EEE51101 – Computers Networks 51 2020/2021
How Many Subnets?

Borrow 2 Bits = 22 = 4 Subnets


 If you Borrow 2 Host Bits you do NOT get
4 Subnets. Why?
 Remember the Network Address and
Broadcast Address - Both of these
addresses are Reserved, they cannot be
used!

EEE51101 – Computers Networks 52 2020/2021


How Many Subnets?
Borrowed Available
Class Bits #Subnets Subnets
A,B,C 2 4 2
A,B,C 3 8 6
A,B,C 4 16 14
A,B,C 5 32 30
A,B,C 6 64 62
A,B 7 128 126
A,B 8 256 254
A,B 9 512 510
A,B 10 1,024 1,022
A,B 11 2,048 2,046
A,B 12 4,096 4,094
A,B 13 8,192 8,190
A,B 14 16,384 16,382
A 15 32,768 32,766
A 16 65,536 65,534
A 17 131,072 131,070
A 18 262,144 262,142
A 19 524,288 524,286
A 20 1,048,576 1,048,574
A 21 2,097,152 2,097,150
A 22 4,194,304 4,194,302
EEE51101 – Computers Networks 53 2020/2021
How Many Hosts/Subnet?
Network Network Network Host

S S H H H H H H
The number of Hosts per subnet is calculated using
the following formula:
# Hosts/Subnet = 2# Host Bits Remaining
# Hosts = 26 = 64 hosts/subnet
EEE51101 – Computers Networks 54 2020/2021
How Many Hosts/Subnet?
6 Host Bits Remain = 26 = 64 Hosts
 If there are 6 Host Bits remaining you do
NOT get 64 Hosts/Subnet. Why?
 Each subnetwork has its own Subnetwork
Address and Broadcast Address - Both of
these addresses are Reserved and cannot
be used!
 Thus only 62 Hosts are available.

EEE51101 – Computers Networks 55 2020/2021


How Many Hosts/Subnet?
Borrowed Remaining Available
Class Bits Host Bits #Hosts Hosts
C 2 6 64 62
C 3 5 32 30
C 4 4 16 14
C 5 3 8 6
C 6 2 4 2
B 7 9 512 510
B 8 8 256 254
B 9 7 128 126
B 10 6 64 62
B 11 5 32 30
B 12 4 16 14
B 13 3 8 6
B 14 2 4 2
EEE51101 – Computers Networks 56 2020/2021
Formulas to Remember!

# Subnets Created = 2# Borrowed Bits


 Remember to subtract 2 for the Network
Address and Broadcast Address.

# Hosts/Subnet = 2# Host Bits Remaining


 Remember to subtract 2 for the
Subnetwork Address and Subnetwork
Broadcast Address.
EEE51101 – Computers Networks 57 2020/2021
So How Does This Work?
 We know we need at least 5 subnets. So 23-2 will
give us 6 subnet addresses (Network Addresses).
 We know we need at least 25 nodes per network.
25-2 will give us 30 nodes per subnet (network).
 This will work, because we can take the first 3
bits from the node’s portion of the address to
give to the network portion and still have 5 (8-3)
left for the node portion

EEE51101 – Computers Networks 58 2020/2021


Review
 We have one class C license.
 We need to subnet that into 12 possible
networks.
 Each network needs a maximum of 10 nodes.
 How many bits do we need to take?
24-2=14
4 bits need to be taken from the node portion
and given to the network portion.

EEE51101 – Computers Networks 59 2020/2021


Review
 Will that leave enough bits for the node
portion? We need a maximum of 10 on
each network…
24-2=14
 If we take 4 away, that leaves us with 4.
That is enough for our individual networks
of 10 nodes each.

EEE51101 – Computers Networks 60 2020/2021


Review
 Our new subnet mask will look like this:
11111111.11111111.11111111.11110000
255.255.255.240 128+64+32+16= 240
 Our subnet, or network addresses will be:
206.15.143.0
206.15.143.16 206.15.143.32 206.15.143.48
206.15.143.64 206.15.143.80 206.15.143.96
206.15.143.112 206.15.143.128 206.15.143.144
206.15.143.160 206.15.143.176 206.15.143.192
206.15.143.208 206.15.143.224
EEE51101 – Computers Networks 61 2020/2021
IP subnet zero
 The command allows u to use the first and
last subnet in your network design.
 For example: class C: 192.168.4.0/26 , i.e. :
number of usable subnets = 22 -2 = 2
 After using ip subnet –zero command, u
can now use subnets 0, 64, 128 and 192.
i.e. that 22

EEE51101 – Computers Networks 62 2020/2021


Example for a router enabling the IP
subnet-zero command

EEE51101 – Computers Networks 63 2020/2021


EEE51101 -
Computers
Networks

thank you
for your
attention
Exercise

EEE51101 – Computers Networks 65 2020/2021

You might also like