Computer Network IIIB
Computer Network IIIB
Computer Network IIIB
ACKNOWLEDGEMENT ............................................................................................................. vi
CHAPTER ONE ............................................................................................................................. 2
1.0 Transmission control protocol/internet protocol TCP/IP ...................................................... 2
1.1 Transmission control protocol (TCP) ................................................................................... 7
1.2 User Datagram Protocol (UDP) ............................................................................................ 9
1.3 UDP Segment Format ......................................................................................................... 10
1.4 Port Numbers ...................................................................................................................... 10
1.5 Data Encapsulation ............................................................................................................. 16
1.6 De-encapsulation : .............................................................................................................. 18
1.7 Addressing .......................................................................................................................... 20
1.8 Physical Addresses.............................................................................................................. 21
1.9 Logical Addresses ............................................................................................................... 22
1.10 Port Addresses .................................................................................................................. 24
1.11 Addresses .......................................................................................................................... 26
1.12 Logical Addressing ........................................................................................................... 27
1.13 IPv4 ADDRESSES ........................................................................................................... 27
1.14 Classful Addressing .......................................................................................................... 28
1.15 Network Addresses: Special Purpose ............................................................................... 30
1.16 Application of classes of IP address ................................................................................ 31
1.17 Disadvantages of Classful addressing ............................................................................... 32
1.18 IP terminology .................................................................................................................. 32
1.19 Classless Addressing. ........................................................................................................ 35
1.20 Network Addresses ........................................................................................................... 37
1.21 Subnetting ......................................................................................................................... 38
1.22 Advantages of subnetting a network ................................................................................. 43
1.23 Types of subnetting technique .......................................................................................... 43
1.24 VLSM Design ................................................................................................................... 51
1.25 Introduction to Network Address Translation (NAT) ...................................................... 57
i
ACKNOWLEDGEMENT
I, Mr. Kifaru J. Malale, would like to thank God, my Almighty for giving me the power and
strength to prepare this Study guide. This study guide, is aimed for guiding students at NTA
Level 7 who pursue Advanced Diploma in Telecommunications, on how to go through in order
to cover their syllabus for Computer Network IIIB
Nevertheless, many thanks should go directly to all staff members (Both Academic and
Management Part), who truly, by one way or another advised me, in order to come up with a
good Study guide, that covers what is supposed under the syllabus
vi
vii
CHAPTER ONE
1.0 Transmission control protocol/internet protocol TCP/IP
TCP/IP suite, was created by the department of defense to ensure and preserve data integrity, as
well as maintain communications in the event of catastrophic war
TCP/IP and the DoD model
DoD model is a condensed version of the OSI model. It is composed of only four instead of
seven layers
A.
B.
C.
D.
Network access layer, defines protocols that monitor the exchange of data between hosts
and network, it oversees hardware addressing, defines protocols for physical transmission
of data
Figure bellows, shows the TCP/IP protocols suite, together with how its protocols, are
related to the DoD layers model
Examples of situations where this application protocols helps is, when accessing website,
logging into website of the college/ triumphant while seated home
FTP (File Transfer Protocols)
Is the protocol that helps us to transfer files between two machines, allows access to files
and directories (browsing of files) .But FTP isnt only a protocols, but also is a programs
or an applications that operates as a protocols. FTP can team up with TELNET to
transparently log you into the FTP server and therefore provides for the transfer of files
between those servers and your remote machines. In this case users must be subjected to
an authentication login, which is probably secured with password and user names
implemented by the system administrators to restrict access
As programs, its employed by users, to perform task manually (By hand),
TFTP (trivial file transfer protocols)
This is a compact little protocol that allows only file transfer and receiving between client
machine and server machines. It is different from FTP protocols, in the sense that it cant
provide more functions like FTP protocols, such as browsing of files capability, there is
no authentication when using these protocols, and therefore it is insecure. Few websites,
supports it because of its inherently insecurity
Other disadvantages of TFTP over FTP, is that TFTP can send smaller blocks of files
compared to FTP
the IP address as often as you want, no one will know the difference provided the domain
name is not changed
Shows an example of how a DNS client/server program can support an e-mail program to
find the IP address of an e-mail recipient.
Options May be 0 or a multiple of 32 bits, if any. What this means is that no options have to be
present (option size of 0). However, if any options are used that do not cause the option field to
total
a multiple of 32 bits, padding of 0s must be used to make sure the data begins on a 32-bit
boundary.
Data Handed down to the TCP protocol at the Transport layer, which includes the upper layer
headers.
1.2 User Datagram Protocol (UDP)
This is one of the protocols, that can also delivers informations from source to destinations in
unreliably way. It does this job by utilizing far few network resources (Bandwidth), as TCP does
There is some situation, where it would be wiser for developers to use UDP, instead of TCP.
Examples,
But ultimately, it is up to the application developers who decide whether to use UDP or TCP and
not the user who wants to transfer data faster
Why UDP protocol is called UNRELIABLE Protocol compared to TCP protocol
UDP doesnt sequence the segments and doesnt care about in which order the segments
arrive at the destination
UDP doesnt allows for an acknowledgement of safe arrival of each segment
UDP doesnt create virtual circuit, nor doesnt contact the destination before delivering
information to it (Because of this, its also considered a connectionless protocol)
Note:
This doesnt mean that UDP is ineffective, only that it doesnt handle issues of reliability
as TCP does
TCP for reliability or UDP for faster transfers.
10
Figure below, illustrates how both TCP and UDP use port numbers.
11
This is protocol, whose function is to know, or be aware of all interconnected networks. It can do
this because all the machines on the network have software, or logical, address called an IP
address
IP protocols, looks at the packets destination address, then by using its routing table, then it
decides where a packet is to be sent next by choosing the best path
IP protocol, receives segments from the Host-to-Host layer and fragments them into datagrams
(Packets) if necessary
IP protocol in the router, looks at each packets address. Then, using a routing table, it decides
where a packet is to be sent next, choosing the best path.
Each router (layer 3 device) that receives a datagram makes routing decisions based on the
packets destination IP address.
IP protocol in the router then reassembles datagrams/ packets back into segments on the
receiving side
Figure below, shows an IP header. This will give you an idea of what the IP protocol has to
go through every time user data is sent from the upper layers and is to be sent to a remote
Network.
12
This is also another protocol used at the internet layer for managing the network status in internet
Examples of these management functions, includes,
routes advertisement by the routers, (reporting IP address for the routers interface), All
hosts in the network listens to these advertisement from routers
Destination Unreachable If a router cant send an IP datagram any further; it uses ICMP
to send a message back to the sender, advising it of the situation. Examples check the
figure below, that shows the real situation
13
14
This is also a protocol in the internet layers whose function is to resolve/find/map the
MAC/NIC/physical address of the diskless machine to its corresponding IP address.
Here is how it works
When an IP machine happens to be a diskless machine, it has no way of initially knowing its
IP address. But it does know its MAC address. Reverse Address Resolution Protocol (RARP)
Discovers the identity of the IP address for diskless machines by sending out a packet that
includes its MAC address and a request for the IP address assigned to that MAC address. A
designated machine, called a RARP server, responds with the answer, and the identity crisis is
over. RARP uses the information it does know about the machines MAC address to learn its IP
Address and complete the machines ID portrait.
15
This is also a protocol found in internet layer, whose function is to help hosts from one
subnet to send its packet to another remote subnet at the time when it happens that, the
default gateway configured in this host is down
One advantage of using Proxy ARP is that is can be added to a single router on a network
Without disturbing the routing tables of all the other routers that live there too
But theres a serious downside to using Proxy ARP. Using Proxy ARP will definitely
increase the amount of traffic on your network segment, and hosts will have a larger ARP
table than usual in order to handle all the IP-to-MAC address mappings
1.5 Data Encapsulation
Data Encapsulation is the process where data is wrapped with the protocol information, as it goes
down through each layer of the OSI model at the Sending side
Each layer in the OSI model, communicates with its peer layer on the receiving side by using
protocol Data units (PDU)
Protocol data Units (PDU) holds control information and they are attached to the data, at each
layer of the OSI model
They are usually attached at the header (In front of the data units), but can also be in the trailer.
This PDU information can only be read by the peer layer on the receiving device. After it is read,
the PDU is stripped off, and the data is handed to the next layer up. Figure below, shows PDUs,
and how they attach control information at each layer
16
17
1.6 De-encapsulation :
is the opposite of the ENCAPSULATION, where the control information is removed from the
packet so that only, information/ data for the user remains
Data De-encapsulation, is usually done on the receiving side in the network
Summary of the data encapsulation at the transmitting device
Consider the figure below, so that to understand clearly the data encapsulation procedures
18
Before going further, consider the following explanation, in order to understand port numbers
19
1.7 Addressing
Is the scheme is used in computer networks to locate specific destination in a networks
There are four levels of addresses that are used in an internet employing the TCP/IP protocols:
physical (link) addresses, logical (IP) addresses, port addresses, and specific addresses.
Consider the figure below
Each address is related to a specific layer in the TCPIIP architecture, as shown in figure
below
20
21
The intended destination computer, however, finds a match between the destination address in
the frame and its own physical address. The frame is checked, the header and trailer are dropped,
and the data part is de-encapsulated and delivered to the upper layer.
1.9 Logical Addresses
Logical addresses are necessary for routing packets through different networks interconnected
throughout world
Logical addresses are necessary for universal communications that are independent of
underlying physical networks. Physical addresses are not adequate in an internetwork
environment where different networks can have different address formats
A logical address in the Internet is currently a 32-bit address that can uniquely define a host
connected to the Internet. There are two versions of logical addresses
IP version 4 (IPV4) and IP version 6 (IPV6)
Consider the diagram below
It shows a part of an internet with two routers connecting three LANs. Each device (computer or
router) has a pair of addresses (logical and physical) for each connection.
In this case, each computer is connected to only one link and therefore has only one pair of
addresses. Each router, however, is connected to three networks (only two are shown in the
figure). So each router has three pairs of addresses, one for each connection.
22
23
Since the logical destination address does not match the router's logical address, the router knows
that the packet needs to be forwarded.
Router consults its routing table and ARP to find the physical destination address of the next hop
(router 2), creates a new frame, encapsulates the packet, and sends it to router 2.
Note the physical addresses in the frame. The source physical address changes from 10 to 99.
The destination physical address changes from 20 (router 1 physical address) to 33 (router 2
physical address). The logical source and destination addresses must remain the same; otherwise
the packet will be lost.
At router 2 we have a similar scenario. The physical addresses are changed, and a new frame is
sent to the destination computer. When the frame reaches the destination, the packet is deencapsulated
The destination logical address P matches the logical address of the computer. The data are deencapsulated from the packet and delivered to the upper layer.
1.10 Port Addresses
Is 16 bits in length address used for communication between source and destination processes
running in two Computers
The IP address and the physical address are necessary for a quantity of data to travel from a
source to the destination host. However, arrival at the destination host is not the final objective of
data communications on the Internet
Today, computers are devices that can run multiple processes at the same time. The end
objective of Internet communication is a process communicating with another process
For example, computer A can communicate with computer C by using TELNET. At the same
time, computer A communicates with computer B by using the File Transfer Protocol (FTP). For
these processes to receive data simultaneously, we need a method to label the different processes.
In other words, they need addresses. In the TCPI/IP architecture, the label assigned to a
process is called a port address.
Figure below, shows two computers communicating via the Internet. The sending computer is
running three processes at same time with port addresses a, b, and c. The receiving computer is
running two processes at same time with port addresses j and k.
24
25
1.11 Addresses
Some applications have user-friendly addresses that are designed for that specific address.
Examples include the e-mail address (for example, [email protected]) and the Universal
Resource Locator (URL) (for example, www.mhhe.com). The first defines the recipient of
an e-mail
26
Notations
There are two prevalent notations to show an IPv4 address: binary notation and dotted decimal
notation.
Binary Notation
In binary notation, the IPv4 address is displayed as 32 bits. Each octet is often referred to as a
byte. So it is common to hear an IPv4 address referred to as a 32-bit address or a 4-byte address.
The following is an example of an IPv4 address in binary notation:
01110101 10010101 00011101 00000010
Dotted-Decimal Notation
To make the IPv4 address more compact and easier to read, Internet addresses are usually written
in decimal form with a decimal point (dot) separating the bytes. The following is the dotted
decimal notation of the above address:
117.149.29.2
27
If we turn the other 7 bits all off and then turn them all on, well find the Class A range of
network addresses:
00000000 = 0
01111111 = 127
As the result number of class A networks that can be created is 128 given by 27 =128. This
means a Class A address must be between 0 and 127, inclusive.
So, a Class A network is defined in the first octet between 0 and 127
To complicate matters further, the network address of all 0s (00000000) is reserved to designate
the default route, and additionally the address 127 is reserved for diagnostics, cant be used
either, which means that you can really use the numbers 1-126 to designate class A network
addresses. This means that, the actual number of usable network address for class a is
28
N=27-2=126 addresses
Each class A addresses has 3 bytes (24 bits positions) for the host address of the machine. This
means that, there are total of different unique combinations of hosts addresses given by
N=224 =16,777,216 hosts addresses
But to find the maximum usable number of hosts address or valid hosts addresses, you must
subtract by 2
N=224-2=16,777,214 different hosts, because the hosts addresses with two patterns of either all
0s or of all 1s must be reserved for network address and broadcast address respectively
Class B addresses ranges
In a class B, the first two bytes are assigned to the network address and the remaining two bytes
are used for hosts addresses. The format is as follows
Network. Network. Host. Host
But the internet designers request for comments (RFCs), decided that all class B network
addresses should start with binary digit 1, and the second bit should be zero (0). This leaves 14
bit positions available to manipulate.
In reality we get total number of network address given by N=214 =16384 different unique
network addresses
If you turn the other 6 bits all off and then all on in the first byte, you will find the range for a
Class B network:
10000000=128
10111111=191
As you can see above, class B address range span form 128-191 in the first byte
A class B addresses uses 2 bytes for host address. To find total number of valid hosts for class B
N=216-2= 65,534 (we subtract 2 for the reserved patterns (all 0s for network address, all 1s for
broadcast))
Class C Address ranges
The first 3 bytes of a class C network address are dedicated to the network portion of the address,
with only 1 last byte remaining for host address. The format is as follows
Network. Network. Network. Host
29
But the internet designers request for comments (RFCs), decided that all class C network
addresses first three bits, should start with 110. The internet designers defined that the first 2
bits of the first octet as always turned ON, but the third bit can never be turned ON
The calculation is as follows: 3 bytes or 24 bits minus 3 reserved bits, leaves 21 bits position.
Therefore to find total different unique network address in class C, proceed as follows
N=221 = 2,097,152 different class C networks
Following the same process as the previous classes, convert from binary to decimal to find the
range. Heres the range for a Class C network:
11000000 = 192
11011111 = 223
So, if you see an IP address that starts at 192 and goes to 223, youll know it is a Class C IP
address.
Network Address Ranges: Classes D and E
The addresses between 224 and 255 are reserved for Class D and E networks.
Class D (224239)
is used for multicast addresses and
Class E (240255)
for scientific purposes, but Im not going
into these types of addresses in this book (and you dont need to know them).
0-127
Bits for
Net
ID/Host
ID
8/24
B
C
128-191
192-223
16/16
24/8
Usable
Size/Networks Size/IP
NET ID bits
addresses
8-1=7
27-2=126
16-2=14
24-3=21
214-2=16384
2212=2097152
Hosts/network
(Valid IP
addresses)
224=16777216 2242=162787214
16
2 =65536
216-2=65534
28=256
28-2=254
31
Class A addresses were designed for large organizations with a large number of attached hosts or
routers.
Class B Addresses
Class B addresses was designed for midsize organizations with tens of thousands of attached
hosts or routers.
Class C addresses
Class C addresses were designed for small organizations with a small number of attached hosts
or routers.
1.17 Disadvantages of Classful addressing
One problem with Classful addressing is that each class is divided into a fixed number of blocks
with each block having a fixed size.
We can see the flaw in this design. A block in class A address is too large for almost any
organization. This means most of the addresses in class A were wasted and were not used.
A block in class B is also very large, probably too large for many of the organizations that
received a class B block
A block in class C is probably too small for many organizations.
Class D addresses were designed for multicasting as we will see in a later chapter. Each address
in this class is used to define one group of hosts on the Internet. The Internet authorities wrongly
predicted a need for 268,435,456 groups. This never happened and many addresses were wasted
here too.
And lastly, the class E addresses were reserved for future use; only a few were used, resulting in
another waste of addresses.
1.18 IP terminology
Netid and Hostid
32
In Classful addressing, an IP address in class A, B, or C is divided into netid and hostid. These
parts are of varying lengths, depending on the class of the address. Figure below, shows some
netid and hostid bytes.
In class A, one byte defines the netid and three bytes define the hostid. In class B, two bytes
define the netid and two bytes define the hostid. In class C, three bytes define the netid and one
byte defines the hostid.
Is a 32 bit number made of contiguous 1s followed by contagious 0s. Mask address is being
used by computer to identify NET ID and HOST ID in a given IP address. The default masks
address for classes A, B, and C are shown in Table below. The concept does not apply to classes
D and E.
There are two main ways through which the default mask address can be presented as shown above in the
table, Dotted decimal notation and CIDR notation
CIDR-stands for classless interdomain Routing notation, and it tells us the number of 1s in the
given default masks address. This notation is also called slash notation or Classless Interdomain
Routing (CIDR) notation.
The notation is used in classless addressing, which we will discuss later. We introduce it here
because it can also be applied to Classful addressing
Subnetting
33
Is the process of borrowing bits from the HOST portion of the IP Address (HOST ID),
and reserve them to define the subnet address
Or it means, a process of dividing large network into smaller number of networks, called
subnets
Subnetting increases the number of 1s in the mask, as we will see later when we discuss
classless addressing.
Supernetting
Is the process where by several networks are combined to create a super network or a
supemet
The time came when most of the class A and class B addresses were depleted; however,
there was still a huge demand for midsize blocks. The size of a class C block with a
maximum number of 256 addresses did not satisfy the needs of most organizations
One solution was Supernetting.
In Supernetting, an organization can combine several class C blocks to create a larger
range of addresses.
An organization can apply for a set of class C blocks instead of just one. For example, an
organization that needs 1000 addresses can be granted four contiguous class C blocks.
The organization can then use these addresses to create one super network
Supernetting decreases the number of Is in the mask. For example, if an organization is
given four class C addresses, the mask changes from /24 to /22. We will see that classless
addressing eliminated the need for Supernetting
34
We can see that the restrictions are applied to this block. The addresses are contiguous.
The number of addresses is a power of 2 (16 = 24 ), and the first address is divisible by 16.
35
A better way to define a block of addresses is to select any address in the block and the mask
address. As we discussed before, a mask is a 32-bit number in which the n leftmost bits are 1s
and the 32 n rightmost bits are 0s. However it is a convenient way to express mask address in
CIDR notation
To define the whole block of address given any IP address and Mask Address in CIDR
notation
The IP address and the CIDR notation completely define the whole block (the first address, the
last address, and the number of addresses).
First Address
The first address in the block can be found by setting the 32 - n rightmost bits in the binary
notation of the address to 0s.
Last Address
The last address in the block can be found by setting the 32 - n rightmost bits in the binary
notation of the address to 1s.
Number of Addresses
The number of addresses in the block is the difference between the last and first address. It can
easily be found using the formula 232-n, where n stands for number in CIDR notation
Example
A block of addresses is granted to a small organization. We know that one of the addresses is
205.16.37.39/28. What is the first address and Last address in the block?
Solution
To find first address in the block
The binary representation of the given address is 11001101 00010000 00100101 00100 I 11.
If we set 32 - 28 rightmost bits to 0, we get 11001101 000100000100101 0010000 or
205.16.37.32
36
37
1.21 Subnetting
Is the process of borrowing bits from the HOST portion of the IP Address (HOST ID), and
reserve them to define the subnet address
Or it means, a process of dividing large network into smaller number of networks
Important terms to understand
Broadcast Address
Is the logical addressing (IP addressing) at which all devices connected to a network are able to
receive data gram or information
Subnets
These refers to small networks that obtained as the result of breaking down a large
network by subnetting
Number of subnets
Refers to the total number of smaller networks in a large network. It can be calculated
from the following formula
N=2S , where s stands for number of bits borrowed form hosts portion to Network Portion
Number of valid subnet is obtained by subtracting 2 form total subnets
N=2S -2
Subnet ID
This refers to IP address reserved for defining or identifying a particular subnet among
other subnets in a large network
38
11111111
NET ID
8 bits
00000000
HOST ID
00000000
00000000
24 bits
Default mask address=
CIDR=/8
NET ID
HOST ID
10 bits
22 bits
Number of subnetworks
s 2 bits
N 2s
N 22 4
Number of Hosts per subnetwork
N 222 2 4194302
To find The Network ID for each subnet (4 subnets)
Take 256(28)-192=64, then networks ID should have a fixed Block size of 64, starting with
0, keep adding until you reaches value of a subnet mask address i.e. 192
Sub-nets
Subnet ID
1
255.0.0.0
2
255.64.0.0
3
255.128.0.0
4
255.192.0.0
Assume 4 bits are borrowed from HOST PART to Network part
39
11111111
1111
0000
00000000
NET ID
HOST ID
12 bits
20 bits
00000000
Number of subnetworks
N 2s
s 4 bits
N 24 16
Number of Hosts per subnetwork
N 2h 2
N 220 2 1048574
To find Subnet ID for each 16 subnets
Take 256(28)-240=16, then keep adding 16 starting from 0 in the second octet until you reach
240
16.Subnets
SUBNET ID
1.
255.0.0.0
2.
255.16.0.0
3.
255.32.0.0
4.
255.48.0.0
5.
255.64.0.0
6.
255.80.0.0
40
15
255.224.0.0
16.
255.240.0.0
00000000
NET ID
HOST ID
16 bits
Default Mask Address
00000000
16 bits
11111111
NET ID
17 bits
Subnet Mask Address
0000000
00000000
HOST ID
15 bits
41
Number of subnetworks
N 2s
s 1 bits
N 21 2
Number of Hosts per subnetwork
N 2h 2
N 215 2 32766
To find Subnet ID for each 2 subnets
Take 256-128=128, then keep adding 128 starting from 0 in the third octet until you reach 128
Subnets
1.
2.
Subnet ID
255.255.0.0
255.255.128.0
Block Size
Block size is the size of subnet including network address, hosts addresses and broadcast
address.
Block size can be calculated using formula below
Block size N=2h , where h represent number of host bit available in given address
Octet /byte
Refers to portion of the IP address that contains 8 bits, each bits can have decimal
equivalent, as shown in the following table, with the highest decimal number starting
form most significant bit (MSB), and the lowest decimal number to the least significant
bit (LSB)
Bit Position
Decimal equivalent
1st
2nd 3rd
bit
bit bit
128 64 32
4th 5th
bitt bit
16 8
6th
bit
4
7th
bit
2
8th
bit
1
42
Hosts bit
Refers to the number of bit reserved in a hosts part of an IP address. Maximum number of
host/computers according to the number of hosts bit, can be calculated as shown from the
following table
Number of host bits
(h)
2
3
4
5
6
And so on
This refers to the total number of IP addresses to be assigned to in a given subnet. It can
calculated using the formula below
N=2h , where h stands for number of hosts bit in a given IP address
Number of valid host is obtained by also subtracting 2 from total number of host per subnet
N=2h - 2
1.22 Advantages of subnetting a network
Subnetting breaks large network in smaller networks and smaller networks are easier to
manage.
Subnetting reduces network traffic by reducing collision domains and broadcast
Domains, that overall improve performance.
Subnetting allows you to apply network security polices at the interconnection between
subnets.
Subnetting allows you to save money by reducing requirement for IP range.
43
It was the first technique to be used in subnetting procedures, but it had the disadvantages
of not providing efficient use of IP addresses. This was due to the fact that, same block
size of network address was allocated to all subnets regardless of the individual subnets
size
A critical issue when borrowing bits from the host ID to create the subnet ID is to accurately
determines the following information:
1. How many subnets are needed
2. How many bits must be borrowed from the host ID field for the new subnet ID field to
accommodate the required number of subnets
3. What is the largest number of hosts that will ever be on a given subnet
4. How many bits must be retained in the host ID field to accommodate the maximum
number of hosts needed
These considerations mandate that careful planning should be carried out before the subnetting
process is begun. It is obviously prudent to plan for future as well as for current needs. Once preplanning is complete, the actual subnetting process involves the following steps:
1.
2.
3.
4.
44
Steps 1:
Identify the class of the IP address
This is a class C, with 24 network bits, and 8 Hosts bits
Find the number of bits to be borrowed from host part (smalls) in order to have 2 subnets
using the following formula below
N 2s 2, N 2
2 2s 2
2s 4
2 s 22
s 2 bits
Step 2:
Find total number Host bits to remain in host part (small h), in order to have maximum of
30 hosts/subnet, using the following formula
N 2h 2, N 30
30 2h 2
2h 32
2 h 25
h 5 bits
But for class C, we have total of 8 bits, but s+h=2+5=7-bits, there is extra of 8-7=1 unused
bit, this unused bit should be added to the borrowed bitss, because in any organization is
more likely to run short of subnets rather than hosts on a subnet, therefore we allocate the
extra bit to s, incrementing s=2+1=3 borrowed bits
In this case the number of sub networks will change to
N 2s 2, s 3
N 23 2 8 2 6
But the number of hosts per sub networks will remain constant as before
45
N 2h 2, h 5 bits
N 25 2 30 hosts
Since we had three bits borrowed from the host part to network part, therefore the default
mask address change to custom mask address/subnet mask address as shown below in a table
Decimal notation
255.255.255.0
255.255.255.224
CIDR Notation
/24
/27
Step 3
Determine the block size and hence Subnet ID and Valid IP address for each of 6 Subnets
Block size=256-224=32, then keep adding 32 to the left most zero octet until you reaches 224
(customer mask address)
Or To find block size, use N=2h , where h represent number of host bit remained after borrowing
Original Network ID (not a valid subnet
address since subnet ID is all 0s)
Address for subnet 1
193.200.35.0
193.200.35.33
193.200.35.62
Broadcast Address
Address for subnet 2
193.200.35.63
193.200.35.64
193.200.35.65
193.200.35.94
Broadcast Address
Address for subnet 3
193.200.35.95
193.200.35.96
193.200.35.97
193.200.35.126
Broadcast IP address
Address for subnet 4
193.200.35.127
193.200.35.128
193.200.35.32
46
193.200.35.129
193.200.35.158
Broadcast IP address
Address for subnet 5
193.200.35.159
193.200.35.160
193.200.35.161
193.200.35.190
Broadcast IP address
Address for subnet 6
193.200.35.191
193.200.35.192
193.200.35.193
193.200.35.222
Broadcast IP address
193.200.35.223
193.200.35.224
Step 4:
Draw the network above in a packet tracer, and simulate to see the network performance
In this case we are going to select use DHCP protocol; where by each subnets we will select
three Hosts only in order to save space
R1(config-if)#exit
R1(config)#ip dhcp pool Subnet1
R1(dhcp-config)#network 193.200.35.32 255.255.255.224
R1(dhcp-config)#default-router 193.200.35.33
R1(dhcp-config)#exit
R1(config)#interface fa 0/1
R1(config-if)#ip address 193.200.35.65 255.255.255.224
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#ip dhcp pool Subnet2
R1(dhcp-config)#network 193.200.35.64 255.255.255.224
R1(dhcp-config)#default-router 193.200.35.65
R1(dhcp-config)#exit
R1(config)#interface serial 0/0/0
R1(config-if)#ip address 193.200.35.97 255.255.255.224
48
R2(config-if)#exit
R2(config)#ip dhcp pool subnet4
49
50
From the Network above, it is required to be broken down into the following smaller subnets
Network A : 14 hosts
Network B : 30 Hosts
Network C ;20 Hosts
Network D : 6 hosts
For WAN link, each has maximum of two hosts
Network E: 2 hosts
Network F: 2 hosts
Network G: 2 Hosts
Network H ; 2 Hosts
Therefore we have total of 8 subnets, each with its own hosts requirement
When subnetting, start with subnet having largest number of hosts going down to subnet having
lower number of hosts
Given Network address 192.168.10.0/24
Start with Network B; 30 hosts
To accommodate 30 Hosts for network B
Find number of bits to be retained in the HOST ID is
N 2h 2, N 30 Hosts
30 2h 2
2h 32
2h 25 , h 5 bits
Then for class C, 8 bits-5-bits=3 extra bits, must be transferred to NET PART, making total of
24-bits+3-extra bits=27 network Bits
The Network Address for this network will be 192.168.10.0/27 or 192.168.10.0 255.255.255.224
Subnet Mask: 255.255.255.224
52
N 2h 2, N 20 Hosts
20 2h 2
2h 22
22 cannot be exp ressed in power of 2, proceed below
Since 2h=22 hosts, is not in the table, take the next higher number from the table which is 2h=32
2h =25
H=5-host-bits to be retained in the Host part
This require 5 number of host bits to be retained In the hosts part, since from the beginning
number of hosts bit retained is still 5, no extra bits to be transferred to the NET part . Then we
will continue to use the next IP address without changing anything in this NETWORK C
The Network Address for this network C will be 192.168.10.32/27 or 192.168.10.32
255.255.255.224
Therefore valid Hosts will be N=2h -2=25-2=32-2=30 Valid Hosts
Custom Subnet Mask Address: 255.255.255.224
Network Address: 192.168.10.32
Valid address range: 192.168.10.33 to 192.168.10.62
Broadcast Address: 192.168.10.63
Next IP address 192.168.10.64/27
53
Network A : 14 hosts
Find number of bits to be retained in the HOST ID, proceed as follows
N 2h 2, N 14 Hosts
14 2h 2
2h 16
2h 24 , h 4 bits
Therefore, 4 bits must be retained in the host part, therefore 5 bits-4 retained bits =1 extra bits,
to be transferred to NET PART, making total of 27-bits+1-extra bit=28 network Bits
N 2h 2, N 6 Hosts
6 2h 2
2h 8
2h 23 , h 3 bits
Therefore, 3 bits must be retained in the host part, therefore 4 bits-3 retained bits =1 extra bits,
to be transferred to NET PART, making total of 28-bits+1-extra bit=29 network Bits
N 2h 2, N 2 Hosts
2 2h 2
2h 4
2h 22 , h 2 bits
Therefore, 2 bits must be retained in the host part, therefore 3 bits-2 retained bits =1 extra bits,
to be transferred to NET PART, making total of 29-bits+1-extra bit=30 network Bits
The Network Address for this network will be 192.168.10.88/30 or 192.168.10.88
255.255.255.252
Subnet Mask/ custom subnet Mask address: 255.255.255.252
Network Address: 192.168.10.88
Valid address range: 192.168.10.89 to 192.168.10.90
Broadcast Address: 192.168.10.91
Next IP address 192.168.10.92/30
Network F : 2 Hosts
Find number of bits to be retained in the HOST ID, proceed as follows
N 2h 2, N 2 Hosts
2 2h 2
2h 4
2h 22 , h 2 bits
Therefore, 2 bits must be retained in the host part, since the Host PART is having 2 Bits; there
are no extra bits to be transferred to the Net PART
55
N 2h 2, N 2 Hosts
2 2h 2
2h 4
2h 22 , h 2 bits
Therefore, 2 bits must be retained in the host part, since the Host PART is still having 2 Bits;
there are no extra bits to be transferred to the Net PART
The Network Address for this network will be 192.168.10.96/30 or 192.168.10.96
255.255.255.252
Subnet Mask/ custom subnet Mask address: 255.255.255.252
Network Address: 192.168.10.96
Valid address range: 192.168.10.97 to 192.168.10.98
Broadcast Address: 192.168.10.99
Next IP address 192.168.10.100/30
56
Network G : 2 Hosts
Find number of bits to be retained in the HOST ID, proceed as follows
N 2h 2, N 2 Hosts
2 2h 2
2h 4
2h 22 , h 2 bits
Therefore, 2 bits must be retained in the host part, since the Host PART is still having 2 Bits;
there are no extra bits to be transferred to the Net PART
The Network Address for this network will be 192.168.10.100/30 or 192.168.10.100
255.255.255.252
Subnet Mask/ custom subnet Mask address: 255.255.255.252
Network Address: 192.168.10.100
Valid address range: 192.168.10.101 to 192.168.10.102
Broadcast Address: 192.168.10.103
1.25 Introduction to Network Address Translation (NAT)
This was the technique established to conserve Internet global address space by translating your
private inside network addresses to a global outside address.
In NAT terminology, the inside network is the set of networks that are subject to translation. The
outside network refers to all other addressesusually those located on the Internet
57
Overloading NAT
Overloading is a form of dynamic NAT that maps multiple unregistered IP addresses to a
single registered IP address (many-to-one) by using different ports. Therefore, its also
known as port address translation (PAT).
58
59
1.30 IP Configuration
Is the process of assigning IP addresses to each computer in a network? Basically, there are two
ways of assigning IP addresses to a computer network
i.
Static IP configuration
Dynamic IP configuration
This is a type of IP configuration. Where IP addresses are dynamically assigned to each
host in a computer network using DHCP server. IT personnel is only required to create
Dynamic Host Configuration protocol (DHCP) server in a Router or DNS Server, where
a pool of IP addresses will be defined. Once a host wants to connect to an internet, it will
request an IP addresses from the server in a router or DNS server, depending on where
the server has been defined
Configuration of DHCP protocol server in a CISCO router
Consider the network address 192.160.120.0/24, being subnetted into two subnets. Each subnets
has the host requirements shown in figure below.
60
Router#config t
Router(config)#interface fa 0/1
Router(config-if)#ip address 192.160.120.33 255.255.255.240
Router(config-if)#no shutdown
Router(config-if)#
Router(config-if)#exit
61
62
CHAPTER TWO
2.0 Routing basics
The term routing is used for taking a packet from one device and sending it through the network
to another device on a different remote network. Routers dont really care about hoststhey
only care about networks and the best path to each network.
The router learns about remote networks from neighbor routers or from an administrator. The
router then builds a routing table that describes how to find the remote networks. If a network is
directly connected, then the router already knows how to get to it. If a network isnt connected,
the router must learn how to get to the remote network in two ways:
i.
ii.
63
64
If both advertised routes has the same value of AD, then routing protocols metrics like
hop-count or bandwidth will be used to evaluate the best route
Consider the following table, that indicate default administrative distance
The 150 at the end changes the default administrative distance (AD) of 1 to 150. No
worries Ill talk much more about AD when we get into dynamic routing. For now, just
remember that the AD is the trustworthiness of a route, where 0 is best and 255 is worst.
Example:
Create routing tables in each router in the following network, use network address
192.160.120.0/24
Note that:
Each routing table automatically includes directly connected networks. To be able to
route to all networks in the internetwork, the routing table must include information that
describes where these other networks are located and how to get there.
65
Router(config-if)#
Router(config-if)#exit
Router(config)#ip dhcp pool subnetA
Router(dhcp-config)#network 192.160.120.32 255.255.255.224
Router(dhcp-config)#default-router 192.160.120.33
Router(dhcp-config)#exit
Router(config)#interface fa 0/1
Router(config-if)#ip address 192.160.120.1 255.255.255.224
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#ip dhcp pool subnetB
Router(dhcp-config)#network 192.160.120.0 255.255.255.224
Router(dhcp-config)#default-router 192.160.120.1
Router(dhcp-config)#exit
Router(config)#interface serial 0/0/0
66
Router(config)#
Router(config)#exit
Router#exit
68
Router(config)#exit
In this case, two remotes subnets will be automatically added to the routing table. By
using again sh ip route command, you will see the routes has been automatically added
to the routing table as shown below
70
Link state routers know more about the internetwork than any distance-vector routing protocol.
OSPF is an IP routing protocol that is completely link state. Link state protocols send updates
containing the state of their own links to all other routers on the network.
c) Hybrid
Hybrid protocols use aspects of both distance vector and link state
71
Now construct the following network in a packet tracer, the configure the whole network,
the at last configure the routing table using RIPV1 protocol
72
73
Router>en
Router#config t
Router(config)#router rip
Router(config-router)#network 192.160.120.0
Router(config-router)#network 192.160.121.0
Router(config-router)#exit
Router(config)#exit
Configuration in router1
Router>en
Router#config t
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.160.121.2 255.255.255.0
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)# exit
Router(config)#interface serial 0/0/1
Router(config-if)#ip address 192.160.122.1 255.255.255.0
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#exit
Router#exit
Router>en
Router#config t
Router(config)#router rip
Router(config-router)#network 192.160.121.0
Router(config-router)#network 192.160.122.0
Router(config-router)#exit
Router(config)#exit
Router# exit
74
Configuration in Router2
Router>en
Router#config t
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.160.122.2 255.255.255.0
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 0/0/1
Router(config-if)#ip address 192.160.123.1 255.255.255.0
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#exit
Router#exit
Router>en
Router#config t
Router(config)#router rip
Router(config-router)#network 192.160.122.0
Router(config-router)#network 192.160.123.0
Router(config-router)#exit
Router(config)#exit
Router#exit
Configuration in router3
Router>en
Router#config t
Router(config)#interface serial 0/0/1
Router(config-if)#ip address 192.160.123.2 255.255.255.0
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
75
Router(config)#interface
Router(config)#interface fa 192.160.124.1 255.255.255.0
^
Router(config)#interface fa 0/0
Router(config-if)#ip address 192.160.124.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
Router(config-if)#exit
Router(config)#ip dhcp pool SubnetE
Router(dhcp-config)#network 192.160.124.0 255.255.255.0
Router(dhcp-config)#default-router 192.160.124.1
Router(dhcp-config)#exit
Router(config)#exit
Router#
Router#exit
Router>en
Router#config t
Router(config)#router rip
Router(config-router)#network 192.160.123.0
Router(config-router)#network 192.160.124.0
Router(config-router)#exit
Router(config)#exit
Router#exit
76
Applying RIP routing protocol in a network that has been subnetted in a Classful
Given the following computer network, with network address 192.160.120.0/27,
subnetted as shown below
Router(config-if)#exit
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.160.120.65 255.255.255.224
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#ip dhcp pool subnetA
Router(dhcp-config)#network 192.160.120.0 255.255.255.224
77
Router(dhcp-config)#default-router 192.160.120.1
Router(dhcp-config)#exit
Router(config)#ip dhcp pool subnetB
Router(dhcp-config)#network 192.160.120.32 255.255.255.224
Router(dhcp-config)#default-router 192.160.120.33
Router(dhcp-config)#exit
Router(config)#exit
Router#exit
Note that, in a Classful subnetting, You would only need to type in the Classful network
address of 192.160.120.0 and let RIP find the subnets and place them in the routing table.
As shown below
Router>en
Router#config t
Router(config)#router rip
Router(config-router)#network 192.160.120.0
Router(config-router)#exit
Router(config)#exit
Router configuration in router1
Router>en
Router#config t
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.160.120.66 255.255.255.224
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface fa 0/1
Router(config-if)#ip address 192.160.120.129 255.255.255.224
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#ip dhcp pool subnetE
Router(dhcp-config)#network 192.160.120.128 255.255.255.224
Router(dhcp-config)#default-router 192.160.120.129
Router(dhcp-config)#exit
Router(config)#interface fa 0/0
Router(config-if)#ip address 192.160.120.97 255.255.255.224
78
Router(config-if)#no shutdown
Router(config-if)#
Router(config)#ip dhcp pool subnetD
Router(dhcp-config)#network 192.160.120.96 255.255.255.224
Router(dhcp-config)#default-router 192.160.120.97
Router(dhcp-config)#exit
Router(config)#exit
Remember again, in a Classful subnetting, You would only need to type in the Classful
network address of 192.160.120.0 and let RIP find the subnets and place them in the
routing table. As shown below
Router>en
Router#config t
Router(config)#router rip
Router(config-router)#network 192.160.120.0
Router(config-router)#exit
Router(config)#exit
So while yes, its true that RIP has worked really well in our little internetwork, its not the
solution for every enterprise. Thats because this technique has a maximum hop count of only 15
(16 is deemed unreachable) and it performs full routing-table updates every 30 seconds, both
things that can wreak havoc in a larger internetwork.
2.10 Holding Down RIP Propagations
You probably dont want your RIP network advertised everywhere on your LAN and WAN.
Theres not a whole lot to be gained by advertising your RIP network to the Internet, here are a
few different ways to stop unwanted RIP updates from propagating across your LANs and
WANs. The easiest one is through the passive-interface command.
This command prevents RIP update broadcasts from being sent out a defined interface, but that
same interface can still receive RIP updates.
Heres an example of how to configure a passive-interface on a router:
Lab_A#config t
Lab_A(config)#router rip
Lab_A(config-router)#network 192.168.10.0
Lab_A(config-router)#passive-interface serial 0/0
This command will stop RIP updates from being propagated out serial interface 0, but serial
interface 0 can still receive RIP updates.
79
80
IGRP has a maximum hop count of 255 with a default of 100. This is helpful in larger
networks and solves the problem of 15 hops being the maximum possible in a RIP
network
IGRP also uses a different metric than RIP. IGRP uses bandwidth and delay of the line as
a metric for determining the best route to an internetwork.
Lab_A#config t
Lab_A(config)#router igrp 10
Lab_A(config-router)#network 192.168.10.0
Notice that the configuration in the above router commands is as simple as in RIP routing
except that IGRP uses an AS number. This number advertises only to the specific routers you
want to share routing information with.
2.15 Open Shortest Path First (OSPF) Basics
Open Shortest Path First (OSPF) is an open standards routing protocol thats been implemented
by a wide variety of network vendors, including Cisco. if you have multiple routers
and not all of them are Cisco, then only remaining options for configuring routing table in
routers are basically RIPv1, RIPv2, or OSPF. If its a large network, then, really, your only
options are OSPF
OSPF is the first link-state routing protocol that most people are introduced to
OSPF provides the following features:
OSPF is supposed to be designed in a hierarchical fashion, which basically means that you
can separate the larger internetwork into smaller internetworks called areas. This is the best
design for OSPF.
81
This does not make configuring OSPF easier, but more elaborate and difficult. Figure below
shows a typical OSPF simple design.
Notice how each router connects to the backbonecalled area 0, or the backbone area. OSPF
must have an area 0, and all routers should connect to this area if at all possible, but routers that
connect other areas to the backbone within an AS are called Area Border Routers
82
CHAPTER THREE
3.0 Routing and switching
3.1 Layer 2 Switching
When we discuss switching, were talking about layer 2switching unless we say otherwise. Layer
2 switching is the process of using the hardware address of devices on a LAN to segment a
network. Switching breaks up large collision domains into smaller ones, and that a collision
domain is a network segment with two or more devices sharing the same bandwidth. A hub
network is a typical example of this type of technology
3.2 Differences between HUB and Switch as layer 2 switching devices
HUB
This refers to the device that connects all the segments in the star topology Ethernet network
Every device in the network connects to the HUB through a single port, and is used to connects
multiple devices without segmenting the network
3.3 What is Network Segmentation?
Therefore, for the HUB as the networking devices, any transmission received on one port,
will be sent out to the all other ports in the HUB, including the receiving pair of the
transmitting devices, so that carrier sense multiple access with collision detection
(CSMA/CD), on the transmitter can monitor the collision
A collision domain is a section of a network where data packets can collide with one another
when being sent on a shared medium or through repeaters, particularly when using early
versions of Ethernet. A network collision occurs when more than one device attempts to send
a packet on a network segment at the same time. Collisions are resolved using carrier sense
multiple access with collision detection (CSMA/CD) in which the competing packets are
discarded and re-sent one at a time. This becomes a source of inefficiency in the network.[1]
83
It is important to note that, HUBS are just like the repeaters, which lack the intelligence
because, a broadcast sent out by any device on the HUB will be propagated to all other
devices connected to the HUB and this phenomena leads to the potential increasing of
collision in the LAN network. Hence HUBS are not suggested in todays networks for this
reason
A switch
Switch connects multiple segments together, much like the HUBS do, but with three
significant differences. A is more intelligent by recognizing the frame and pay attention to
the source and destination MAC address of the incoming frame as well as the port in which
the frame was received
HUBS dont do these things, they simply send out anything they receive on one port to all
other ports including the receiving port
So if a switch determines that, a frame final destination happens to be on one segment thats
connected via a different port than the one on which the frame was received , the switch will
only forward the frame out form the specific port on which the destination MAC address is
located
If the switch cant figure out the location of the frame destination, it will flood the frame out
every port except the one on which the frame port was received
Switches are layer 2 devices, which mean they segment the network with MAC address. IF
you see the term layer 3 switch, that means you are talking about the router, not a layer 2
switch. Consider the figure below, it shows , the differences between HUBS and switches in
segmenting the network
3.5 What is collision Domains?
A collision domain is, as the name implies, a part of a network where packet collisions can
occur. A collision occurs when two devices send a packet at the same time on the shared network
segment. The packets collide and both devices must send the packets again, which reduces
network efficiency. Collisions are often in a hub environment, because each port on a hub is in
the same collision domain. By contrast, each port on a bridge, a switch or a router is in a separate
collision domain.
84
85
Address learning
Layer 2 devices, such as bridges and switches have the ability of learning addresses, i.e. they
remember source MAC addresses (Physical address) of each frame received on an interface and
enter this information into a MAC database known as forward filter table. But when the switch is
at first switched ON, always the forward filter table is empty as shown below
86
Loop avoidance
Redundant links between switches are very wise thing to implement because they help prevent
complete network failure in the event that one link stop working. But these redundant links have
disadvantages , because the frame can be flooded down all redundant links simultaneous
creating loops. Here are the few problems caused by these loops, especially when no mechanism
to avoid these loop has been placed
3.9 Disadvantages of loop in LAN network
i.
Broadcast Storm
This is a process where The switch will flood the broadcast endlessly throughout the
internetwork. In real life, it is often referred to as , something that were to permitted to repeat in
print. The figure below illustrate how broadcast can be propagated throughout the internetwork
87
ii.
Slowing down the network
What you see here, is that a device receives, multiple copies of the same frame, because that
frame can arrive from different segments at the same time. Figure below demonstrates how a
bunch of frame can arrive from multiple segments simultaneously
A server from a router in the figure, sends a unicast frame to router C. because it is a unicast
frame, switch A forward the frame, and switch B provides the same services by forwarding this
unicast frame
This is really bad, because the router C, receives the unicast frame twice, causing additional
overhead in the network
Multiple loops propagating in the network can leads to the failure of the switch to
perform its frame switching task especially when the broadcast storms happens
89
First, anyone connecting to the physical network could access the network resources
located on that physical LAN.
Second, all anyone had to do to observe any and all traffic happening in that network was
to simply plug a network analyzer into the hub.
Third, in that same vein, users could join a workgroup by just plugging their workstations
into the existing hub. So basically, this was non-security!
This is why VLANs are so cool. By building them and creating multiple broadcast groups,
administrators can now have control over each port and user! The days when users could just
plug their workstations into any switch port and gain access to network resources are history,
because the administrator is now awarded control over each port and whatever resources that
port can access.
But devices called bridges did, and they were first used in the network to break up collision
domains. Bridges were sorely limited by the amount of ports and other network services they
could provide, and thats when layer 2 switches came to the rescue. These switches saved the day
90
by breaking up collision domains on each and every portlike a bridge, and switches could
provide hundreds of ports!
3.14 Virtual Local Area Network (VLANs)
A VLAN is a logical grouping of network users and resources connected to administratively
defined ports on a switch. We can break up broadcast domains in a pure switched internetwork,
By creating a virtual local area network (VLAN).
When you create VLANs, you are given the ability to create smaller broadcast domains within a
layer 2 switched internetworks by assigning different ports on the switch to different sub
networks. A VLAN is treated like its own subnet or broadcast domain, which means that frames
broadcast onto the network are only switched between the ports logically grouped within the
same VLAN.
By default, no hosts in a specific VLAN can communicate with any other hosts that are members
of another VLAN, so if you want inter-VLAN communication, the router will be needed
VLAN Basics
As shown in Figure below, layer 2 switched networks are typically designed as flat networks.
Every broadcast packet transmitted is seen by every device on the network, regardless of whether
the device needs to receive that data. By default, routers allow broadcasts only within the
originating network, but switches forward broadcasts to all segments. The reason its called a flat
network is because its one broadcast domain, not because its actual design is physically flat.
91
Now look at Figure below, which pictures a switched network. It shows Host A sending a frame
with Host D as its destination, and as you can see, that frame is only forwarded out the port
where Host D is located. This is a huge improvement over the old hub networks, unless having
one collision domain by default is what you really want.
92
93
Dynamic VLAN
95
Switch(config-vlan)#name mis
Switch(config-vlan)#exit
Switch(config)#exit
After you create the VLANs that you want, you can use the show vlan command to see them.
But notice that by default, all ports on the switch are in VLAN 1. To change the VLAN
associated with a port, you need to go to each interface and tell it which VLAN to be a part of.
97
98
Trunk links Trunks can carry multiple VLANs and originally gained their name after the
telephone system trunks that carry multiple telephone conversations.
Configuring Trunk ports
On the 2950, you use the switchport command:
Switch#config t
Switch(config)#int f0/12
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit
Switch(config)#exit
You can verify your configuration with the show running-config command:
99
100
2950(config)#int f0/6
2950(config-if)#switchport access vlan 2
2950(config-if)#exit
2950(config)#exit
2950#
Before we configure the router, we need to design our logical network for all the three VLANs
we created as follows. Use the network IP address 192.168.10.0/24
VLAN 1: 192.168.10.16/28
VLAN 2: 192.168.10.32/28
VLAN 3: 192.168.10.48/28
Router(config-if)#
Router(config-subif)#encapsulation dot1q 2
102
Router(config-subif)#encapsulation dot1q 3
Router(config-subif)#ip address 192.168.10.49 255.255.255.240
Router(config-subif)#exit
Router(config)#exit
Router#exit
The hosts in each VLAN would be assigned an address from their subnet range, and the default
gateway would be the IP address assigned to the routers sub interface in that VLAN.
Figure below shows a router connected to a 2950 switch with two VLANs. One host in each
VLAN is assigned an IP address. What are your router and switch configurations based on these
IP addresses?
103
You should know by now that the subnets are 0 and 128, and the 0 subnet (VLAN 1) has a host
range of 1126 and the 128 subnet (VLAN 2) has a range of 129254. You can almost be fooled
since Host A has an IP address of 126, which makes it almost seem that Host A and B are in the
same subnet
Now, draw the above networks in cisco packet tracer
Router(config-if)#int fa0/0.1
Router(config-subif)#
Router(config-subif)#encapsulation dot1q 1
Router(config-subif)#ip address 192.16.10.1 255.255.255.128
Router(config-subif)#int fa0/0.2
Router(config-subif)#
Router(config-subif)#encapsulation dot1q 2
Router(config-subif)#ip address 192.16.10.129 255.255.255.128
Router(config-subif)#exit
Router(config)#exit
Router#
Router#exit
105
106
Switches detect the additional VLANs within a VTP advertisement and then prepare to receive
information on their trunk ports with the newly defined VLAN in tow. Updates are sent out as
revision numbers that are the notification plus 1. Any time a switch sees a higher revision
number, it knows the information that its receiving is more current, and it will overwrite the
current database with that new information.
3.25 VTP modes of operation
There are three different modes of operation within a VTP domain. Figure below shows you all three:
Server This is the default for all Catalyst switches. You need at least one server in your VTP
domain to propagate VLAN information throughout the domain. The switch must be in server
mode to be able to create, add, or delete VLANs in a VTP domain. Changing VTP information
must also be done in server mode, and any change made to a switch in server mode will be
advertised to the entire VTP domain
Client In client mode, switches receive information from VTP servers, and they also send and
receive updates. But they cant make any changes. Plus, none of the ports on a client switch can
be added to a new VLAN before the VTP server notifies the client switch of the new VLAN.
Its also good to know that VLAN information sent from a VTP server is not stored in NVRAM.
This means that if the switch is reset or reloaded, the VLAN information will be deleted. Heres
a hint: If you want a switch to become a server, first make it a client so it receives all the correct
VLAN information, then change it to a servermuch easier!
Transparent Switches in transparent mode dont participate in the VTP domain, but theyll still
forward VTP advertisements through any configured trunk links. These switches cant add and
delete VLANs because they keep their own databaseone they do not share with other switches.
The purpose of Transparent mode is to allow remote switches to receive the VLAN database
from a VTP Server configured switch through a switch that is not participating in the same
VLAN assignments.
107
108
By default all switches work as VTP server so we only need few commands to configure it. In
following commands we will
Set hostname to S1
Set domain name to rt
Set password to kifaru. (Password is case sensitive)
Switch(config)#hostname S3
S3(config)#vtp mode client
S3(config)#vtp domain rt
S3(config)#vtp password kifaru
We have configured VTP server and VTP client. At this moment VTP client will not receive
VTP messages from server. We need to configure DTP (Dynamic Trunk Protocol) between
switches.
Office switch0
Switch>en
Switch#config t
S1(config)#int fa0/4
S1(config-if)#switchport mode trunk
S1(config-if)#exit
S1(config)#int fa0/1
S1(config-if)#switchport mode trunk
S1(config-if)#exit
Office switch1
Switch>en
Switch#config t
S2(config)#int fa 0/1
S2(config-if)#switchport mode trunk
S2(config-if)#exit
S2(config)#int fa 0/2
S2(config-if)#switchport mode trunk
S2(config-if)#exit
110
Office switch2
Switch>en
Switch#config t
S3(config)#int fa 0/1
S3(config-if)#switchport mode trunk
S3(config-if)#exit
So far up to this point, we have configured VTP server and VTP clients. We have also changed
necessary links in trunk. Now we will configure VLANs on VTP server and that will
automatically propagate VLANs in network.
Configure VLAN
Now go to office switch0, which is our VTP server`
Switch>en
Switch#config t
S1(config)#vlan 10
S1(config-vlan)#exit
S1(config)#vlan 20
S1(config-vlan)#exit
Then we must start assigning VLAN membership
Assign VLAN Membership
VLAN can be assigned statically or dynamically. But we will use static method to assign VLAN
membership. switchport access vlan [vlan number] command is used to assign VLAN to the
interface. Following commands will assign VLANs to the interfaces.
111
Office switch0
Switch>en
Switch#config t
S1(config)#int fa 0/2
S1(config-if)#switchport access vlan 10
S1(config-if)#int fa 0/3
S1(config-if)#switchport access vlan 20
S1(config-if)#exit
S1(config)#exit
Office switch1
Switch>en
Switch#config t
S2(config)#int fa 0/3
S2(config-if)#switchport access vlan 10
S2(config-if)#int fa 0/4
S2(config-if)#switchport access vlan 20
S2(config-if)#exit
S2(config)#exit
Office switch2
Switch>en
Switch#config t
S3(config)#interface fa 0/2
S3(config-if)#switchport access vlan 10
112
S3(config-if)#int fa 0/3
S3(config-if)#switchport access vlan 20
S3(config-if)#exit
S3(config)#exit
We have successfully assigned VLAN membership. It's time to test our configuration. To test
this configuration, we will use ping command. ping command is used to test connectivity
between two devices. As per our configuration, devices from same VLAN can communicate.
Devices from different VLANs must not be able to communicate with each other without router.
Configure Router on Stick
Typically routers are configured to receive data on one physical interface and forward that data
from another physical interface based on its configuration. Each VLAN has a layer 3 address that
should be configured as default gateway address on all its devices. In our scenario we reserved
IP address 10.0.0.1 for VLAN 10 and 20.0.0.1 for VLAN 20.
With default configuration we need two physical interfaces on router to make this intra VLAN
communication. Due to price of router, its not a cost effective solution to use a physical
interface of router for each VLAN. Usually a router has one or two Ethernet interface. For
example if we have 50 VLANs, we would need nearly 25 routers in order to make intra VLANs
communications. To deal with situation we use Router on Stick.
Router on Stick is router that supports trunk connection and has an ability to switch frames
between the VLANs on this trunk connection. On this router, single physical interface is
sufficient to make communication between our both VLANs.
Access command prompt of Router
Run following commands in same sequence to configure Router on Stick
Router>en
Router#config t
Router(config)#int fa 0/0
Router(config-if)#no ip address
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#int fa 0/0.10
113
Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#ip address 10.0.0.1 255.0.0.0
Router(config-subif)#exit
Router(config)#int fa 0/0.20
Router(config-subif)#encapsulation dot1q 20
Router(config-subif)#ip address 20.0.0.1 255.0.0.0
Router(config-subif)#exit
Router(config)#exit
Router#exit
In above configuration we broke up single physical interface [Fast Ethernet 0/0] into two
logical interfaces, known as sub-interfaces. Router supports up to 1000 interfaces
including both physical and logical.
By default interface link works as access link. We need to change it into trunk link.
Encapsulation commands specify the trunk type and associate VLAN with sub-interface.
In next step we assigned IP address to our sub-interface.
That's all configuration we need to switch VLANs. Now we can test different VLAN
communications. To test intra VLANs communication open command prompt of PC and ping
the PC of other VLAN.
114
Virtual Private Network is a type of private network that uses public telecommunication,
such as the Internet, instead of leased lines to communicate.
Became popular as more employees worked in remote locations.
Employees can access the network (Intranet) from remote locations.
Secured networks.
The Internet is used as the backbone for VPNs
Saves cost tremendously from reduction of equipment and maintenance costs.
Scalability
115
Two connections one is made to the Internet and the second is made to the VPN.
Datagrams contains data, destination and source information.
Firewalls VPNs allow authorized users to pass through the firewalls.
Protocols protocols create the VPN tunnels.
Data is encrypted (cannot be deciphered without the key)
Virtual Point to Point Connection
To the user, it acts like a point to point connection
Data is packaged with a header
Authentication validates that the data was sent from the sender.
Access control limiting unauthorized users from accessing the network.
Confidentiality preventing the data to be read or copied as the data is being transported.
Data Integrity ensuring that the data has not been altered
A virtual private network (VPN) is the extension of a private network that encompasses links
across shared or public networks like the Internet. It provides LAN access to end systems not
physically located on the LAN
An alternative to WAN (Wide Area Networks) which use leased lines to connect
116
117
Typically done by purchasing a NAS (Network Access Server) with a toll free
number
Can instead be done through normal ISP connection using the VPN software to
make a virtual connection to the LAN
118
119
CHAPTER FOUR
4.0 Internet Data Centrers (IDCs)
Telecommunication system is an important and integral part of modern society. In addition to
public switched telephone network (PSTN), it plays vital role in radio and television
networks, internet and Asynchronous transfer mode (ATM) networks. The switching system
provides various services to the subscribers
The switching system is a collection of switching elements arranged and controlled in such a
way as to setup a communication path between any two distant points.
Telecommunication is the communication of voice or data over long distances using public
switched telephone network (PSTN). PSTN consists of transmission component, switching
components and facilities for maintaining equipment, billing system and other internal
components.
PSTN also referred to as plain old telephone system (POTS). The switching technique used
in PSTN is circuit switching in general.
4.1 Plain old telephone service (POTS)
Is voice-grade telephone service employing analog signal transmission over copper loops . POTS
was the standard service offering from telephone companies from 1876 until 1988 when the
now-obsolete Integrated Services Digital Network (ISDN) Basic Rate Interface (BRI) was
introduced, followed by cellular telephone systems, and Voice over IP (VoIP). POTS remain the
basic form of residential and small business service connection to the telephone network in many
parts of the world. The term reflects the technology that has been available since the introduction
of the public telephone system in the late 19th century, in a form mostly unchanged despite the
introduction of Touch-Tone dialing, electronic telephone exchanges and fiber-optic
communication into the public switched telephone network (PSTN).
Prior to the mid-1960, the service logic as shown in figure below, was hardwired in the
switching systems. Typically network operators met with the switch vendors, discuss the type of
services the customers required, negotiate the switching features that provided the services, and
finally agreed upon the generic release date for feature availability
120
After this , the network operators planned for the deployment of the generic feature / service in
the switching fabric
121
The SPC enables easier number changes, automated call tracing message unit accounting
(for billing) etc.
All switching systems manufactured for use as public switching systems now use
computers and software programming to control the switching of calls.
4.2 Characteristics of PSTN/POTS
POTS is characterized by several aspect
Plain old telephone service is a voice grade telephone service. It continues to be the basic
form of home and small business service connection to telephone networks around the globe.
The SS7 network shown in figure below, separate the call set up information and talk path from
common trunks that runs between switching systems. The call set up information travel outside
the common trunk over SS7 network . The type of information transferred included permission
for the call set up , and whether or not the called party was busy
123
124
125
126
Protocol Stack
Figure 4.5 :The OSI Reference Model and the SS7 Protocol Stack
Message Transfer Part (MTP)
The Message Transfer Part (MTP) is divided into three levels.
MTP Level 1
Physical and electrical interfaces of SS7 digital signaling links
E-1 (2048kb/s), DS-1 (1544 kb/s), DS-0 (64 kb/s), V.35 (64 kb/s),
DS-0A (56 kb/s)
MTP Level 2
Handles message transmission over a physical link
Includes flow control, packet sequencing, error detection, retransmission
MTP Level 3
Handles message routing between SSPs
127
ISUP is used for both ISDN and non-ISDN calls. Calls that originate and terminate at the
same switch do not use ISUP signaling.
128
129
130
131
The great advantage of the IN concept is that when a new service is introduced or a service is
updated, all exchanges in the network are able to provide the modified service immediately.
132
Free phone: Companies that want to provide free customer service use this service in which the receiver
pays for the call.
Credit card call: A service user can pay with his or her credit card by dialing his or her account number
and identity code.
The modern telecommunications networks using IN technology provide many other services and
a few new ones appear annually. An example of these is inexpensive home-to-mobile and
mobile-to-home calls for which you dial a specific number given by an operator.
Another example is a card service for which a serviceperson dials a specific service number and
security code and the network operator charges his or her employer instead of the telephone from
which he or she is calling.
One category of services implemented with the help of IN technology is value-added services.
This term refers to the services that give additional value, not just point-to-point telephone
conversation. Separate service providers, not the telecommunications service provider, often
provide these services.
Examples of value-added services are telebanking, telephone doctor or lawyer services, and
participation to TV games. IN technology provides flexible routing and service-specific charging
for these services.
4.17 Benefits of Intelligent Networks
The main benefits of IN, is the ability to improve existing services and develop new source of
revenue. To meet these objectives, providers requires to accomplish the following
Introduces new services rapidly IN provide the capability to provision new services
or modify existing services throughout the network with physical intervention
Provide service customization Service providers, requires the ability to change the
service logic rapidly and efficiently. Customers are also demanding control of their own
services to meet their individual needs
Establish vendor independence- A major criterion for the service providers, is that the
software must be developed quickly and inexpensively. To accomplish this, suppliers
must integrate commercially available softwares to create the application required by the
service providers
Create open interface- Open interface allow the service providers to introduce network
element quickly for individualized customers services. The softwares must interface with
other vendors products while still maintain stringent network operation standards.
Services providers, are no longer relying on one or two vendors to provide equipments
and softwares to meet customers requirements
134
Browser Caches
A browser cache is part of all popular Web browsers. The browser keeps a local copy of all
recently displayed pages, and when the user returns to one of these pages, the local copy is
reused.
If you examine the preferences dialog of any modern Web browser (like Internet Explorer, Safari
or Mozilla), youll probably notice a cache setting. This lets you set aside a section of your
computers hard disk to store representations that youve seen, just for you. The browser cache
works according to fairly simple rules. It will check to make sure that the representations are
fresh, usually once a session (that is, the once in the current invocation of the browser).
Proxy Caches
A proxy cache is a shared network device that can undertake Web transactions on behalf of a
client, and, like the browser, the proxy cache stores the content. Subsequent requests for this
content, by this or any other client of the cache will trigger the cache to deliver the locally stored
copy of the content, avoiding a repeat of the download from the original content source.
Consider the diagram below that shows how proxy caches working principles
When a browser wishes to retrieve a URL, it takes the host name component and translates that
name to an IP address. A HTTP session is opened against that address, and the client requests the
URL from the server.
135
When using a proxy cache, not much is altered in the transaction. The client opens a HTTP
session with the proxy cache, and directs the URL request to the proxy cache instead.
136
CHAPTER FIVE
5.0 Network Management
We can define network management as monitoring, testing, configuring, and troubleshooting
network components to meet a set of requirements defined by an organization. These
requirements include the smooth, efficient operation of the network that provides the predefined
quality of service for users. To accomplish this task, a network management system uses
hardware, software, and humans.
5.1 Function of the Network management system
We can say that the functions performed by a network management system can be divided into
five broad categories:
fault management,
configuration management,
accounting management
performance management,
security management
As shown in the figure below, you just need to remember the word FCAPS, where by each letter
represents the function of Network Management system
Configuration Management
A large network is usually made up of hundreds of entities that are physically or logically
connected to one another. These entities have an initial configuration when the network is set up,
but can change with time. Desktop computers may be replaced by others; application software
may be updated to a newer version; and users may move from one group to another. The
137
configuration management system must know, at any time, the status of each entity and its
relation to other entities.
Configuration Management monitors network and system configuration information and
stores it in a configuration management database.
The maintenance of this database allows network administrators to track hardware,
software, and other network resources
Configuration management can be divided into two subsystems: reconfiguration and
documentation.
i.
Reconfiguration
Reconfiguration, which means adjusting the network components and features, can be a daily
occurrence in a large network. There are three types of reconfiguration: hardware
reconfiguration, software reconfiguration, and user-account reconfiguration.
Hardware reconfiguration covers all changes to the hardware. For example, a desktop
computer may need to be replaced. A router may need to be moved to another part of the
network. A subnetwork may be added or removed from the network. All these need the time
and attention of network management
Software reconfiguration covers all changes to the software. For example, new software
may need to be installed on servers or clients. An operating system may need updating.
Fortunately, most software reconfiguration can be automated. For example, updating an
application on some or all clients can be electronically downloaded from the server.
Documentation
ii.
The original network configuration and each subsequent change must be recorded meticulously.
This means that there must be documentation for hardware, software, and user accounts.
Fault Management
Manages network problems to keep the network running reliably and efficiently.Fault
management process involves the following steps
o Detecting the problem symptoms.
o Isolating the problem.
o Fixing the problem automatically (if possible) or manually.
o Testing the fix on all important subsystems.
138
Performance Management
Performance management, which is closely related to fault management, tries to monitor and
control the network to ensure that it is running as efficiently as possible. Performance
management tries to quantify performance by using some measurable quantity such as capacity,
traffic, throughput, or response time.
Performance management involves three basic steps:
1. Gathering data relating to key performance variables.
2. Analyzing data to determine the normal (baseline) performance levels.
3. Determining appropriate performance thresholds for each variable so that
exceeding these thresholds indicates a network problem worthy of attention.
139
Security Management
Security management is responsible for controlling access to the network based on the
predefined policy
Aids administrators in creating a secure network environment. This includes:
partitioning network resources into authorized and unauthorized areas,
mapping groups of users to those areas, and
Monitoring, policing, and logging user access to resources in those areas.
Security monitoring
Security event collection
Event analysis, correlation and alert generation
Alert handling
Accounting Management
Accounting management is the control of users' access to network resources through charges.
Under accounting management, individual users, departments, divisions, or even projects are
charged for the services they receive from the network. Charging does not necessarily mean cash
transfer; it may mean debiting the departments or divisions for budgeting purposes.
o
o
o
o
Today, organizations use an accounting management system for the following reasons:
It prevents users from monopolizing limited network resources.
It prevents users from using the system inefficiently.
Network managers can do short- and long-term planning based on the demand for
network use.
140
141
Agents can also contribute to the management process. The server program running on the agent
can check the environment, and if it notices something unusual, it can send a warning message,
called a trap, to the manager.
In other words, management with SNMP is based on three basic ideas:
1. A manager checks an agent by requesting information that reflects the behavior of
the agent.
2. A manager forces an agent to perform a task by resetting values in the agent database.
3. An agent contributes to the management process by warning the manager of an
unusual situation.
5.4 Internet Management Components
To do management tasks, SNMP uses two other protocols: Structure of Management
Information (SMI) and Management Information Base (MIB). In other words, management
on the Internet is done through the cooperation of the three protocols SNMP, SMI, and MIB, as
shown in Figure below
142
Roles of SMI
SMI is a protocol that defines these rules. However, we must understand that SMI only defines
the rules; it does not define how many objects are managed in an entity or which object uses
which type. SMI is a collection of general rules to name objects and to list their types. The
association of an object with the type is not done by SMI.
SM1 does not define the number of objects an entity should manage or name the objects
to be managed or define the association between the objects and their values.
To use SNMP, we need rules. We need rules for naming objects. This is particularly important
because the objects in SNMP form a hierarchical structure (an object may have a parent object
and some children objects).
Part of a name can be inherited from the parent. We also need rules to define the type of the
objects. What types of objects are handled by SNMP? Can SNMP handle simple types or
structured types? How many simple types are available? What are the sizes of these types? What
is the range of these types? In addition, how are each of these types encoded?
We need these universal rules because we do not know the architecture of the computers that
send, receive, or store these values. The sender may be a powerful computer in which an integer
is stored as 8-byte data; the receiver may be a small computer that stores an integer as 4-byte
data.
Role of MIB
MIB creates a collection of named objects, their types, and their relationships to each other in an
entity to be managed.
For each entity to be managed, this protocol must define the number of objects, name them
according to the rules defined by SMI, and associate a type to each named object. This protocol
is MIB. MIB creates a set of objects defined for each entity similar to a database (mostly
metadata in a database, names and types without values).
143
144
Rather than intercept a message, user F constructs its own message with the desired entries and
transmits that message to computer E as if it had come from manager D. Computer E accepts the
message as coming from manager D and updates its authorization file accordingly.
An employee is fired without warning. The personnel manager sends a message to a server
system to invalidate the employees account. When the invalidation is accomplished, the server
is to post a notice to the employees file as confirmation of the action. The employee is able to
intercept the message and delay it long enough to make a final access to the server to retrieve
sensitive information. The message is then forwarded, the action taken, and the confirmation
posted. The employees action may go unnoticed for some considerable time.
A message is sent from a customer to a stockbroker with instructions for various transactions.
Subsequently, the investments lose value and the customer denies sending the message.
Although this list by no means exhausts the possible types of network security violations, it
illustrates the range of concerns of network security.
5.6 Computer Security
The protection afforded to an automated information system in order to attain the applicable
objectives of preserving the integrity, availability, and confidentiality of information system
resources
This definition introduces three key objectives that are at the heart of computer security:
i.
iii.
Availability: Assures that systems work promptly and service is not denied to authorize
users.
146
Security mechanism: A process (or a device incorporating such a process) that is designed to
detect, prevent, or recover from a security attack.
Security service: A processing or communication service that enhances the security of the data
processing systems and the information transfers of an organization. The services are intended to
counter security attacks, and they
make use of one or more security mechanisms to provide the service.
Types of security attacks
A useful means of classifying security attacks, is in terms of passive attacks and active attacks
A passive attack attempts to learn or make use of information from the system but does not
affect system resources.
An active attack attempts to alter system resources or affect their operation.
5.9 Division of security problems
Security problem can be divided into following areas
ACCESS CONTROL
In the context of network security, access control is the ability to limit and control the
access to host systems and applications via communications links. To achieve this, each
entity trying to gain access must first be identified, or authenticated, so that access rights
can be tailored to the individual.
147
DATA CONFIDENTIALITY
Confidentiality is the protection of transmitted data from passive attacks (prevent a data
from being read by a third party). With respect to the content of a data transmission,
several levels of protection can be identified. The broadest service protects all user data
transmitted between two users over a period of time
For example, when a TCP connection is set up between two systems, this broad
protection prevents the release of any user data transmitted over the TCP connection.
AUTHENTICATION
The assurance that the communicating entity is the one that it claims to be
DATA INTEGRITY
The assurance that data received are exactly as sent by an authorized entity (i.e., contain
no modification, insertion, deletion, or replay).
A connection-oriented integrity service, one that deals with a stream of messages, assures
that messages are received as sent with no duplication, insertion, modification,
reordering, or replays. The destruction of data is also covered
under this service
NONREPUDIATION
Provides protection against denial by one of the entities involved in a communication of
having participated in all or part of the communication.
Nonrepudiation prevents either sender or receiver from denying a transmitted message.
Thus, when a message is sent, the receiver can prove that the alleged sender in fact sent
the message. Similarly, when a message is received, the sender can prove that the alleged
receiver in fact received the message.
148
ii.
iii.
iv.
v.
vi.
Cryptography
The art or science encompassing the principles and methods of transforming an intelligible
message into one that is unintelligible, and then retransforming that message back to its
original form
Plaintext,
This refers to an original message
Ciphertext
This refers to the encoded message
Enciphering or Encryption
The process of converting from plaintext to ciphertext
Deciphering or Decryption
This is a process of restoring the plaintext from the ciphertext
Cryptography.
This refers to the many schemes used for encryption
Symmetric cryptosystems
Important terms to understand under symmetric cryptosystems
Encryption algorithm: The encryption algorithm performs various substitutions and
transformations on the plaintext.
Secret key: The secret key is also input to the encryption algorithm. The key is a value
independent of the plaintext and of the algorithm. The algorithm will produce a different
output depending on the specific key being used at the time. The exact substitutions and
transformations performed by the algorithm depend on the key.
Decryption algorithm: This is essentially the encryption algorithm run in reverse. It takes
the ciphertext and the secret key and produces the original plaintext.
There are two requirements for secure use of conventional encryption:
149
150
Let us take a closer look at the essential elements of a symmetric encryption scheme, using
Figure below
151
Asymmetric cryptosystems
If the sender and receiver use different keys, the system is referred to as asymmetric, two-key,
or public-key encryption.
5.12 Characteristics of cryptographic systems
Cryptographic systems are characterized along three independent dimensions:
1. The type of operations used for transforming plaintext to ciphertext. All encryption
algorithms are based on two general principles: substitution, in which each element in the
plaintext (bit, letter, group of bits or letters) is mapped into another element, and
transposition, in which elements in the plaintext are rearranged. The fundamental
requirement is that no information be lost (that is, that all operations are reversible). Most
systems, referred to as product systems, involve multiple stages of substitutions and
transpositions.
2. The number of keys used. If both sender and receiver use the same key, the system is
referred to as symmetric, single-key, secret-key, or conventional encryption. If the sender
and receiver use different keys, the system is referred to as asymmetric, two-key, or publickey encryption.
3. The way in which the plaintext is processed. A block cipher processes the input one block
of elements at a time, producing an output block for each input block. A stream cipher
processes the input elements continuously, producing output one element at a time, as it
goes along.
5.13 Caesar Cipher Encryption technique
The earliest known, and the simplest, use of a substitution cipher was by Julius Caesar. The
Caesar cipher involves replacing each letter of the alphabet with the letter standing three places
further down the alphabet. For example,
Plaintext: meet me after the toga party
Ciphertext: PHHW PH DIWHU WKH WRJD SDUWB
A substitution technique is one in which the letters of plaintext are replaced by other letters or by
numbers or symbols.1 If the plaintext is viewed as a sequence of bits, then substitution involves
replacing plaintext bit patterns with ciphertext bit patterns.
Note that the alphabet is wrapped around, so that the letter following Z is A. We can define the
transformation by listing all possibilities, as follows:
Plaintext: a b c d e f g h i j k l m n o p q r s t u v w x y z
ciphertext: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
152
Then the algorithm can be expressed as follows. For each plaintext letter p , substitute the
ciphertext letter C :
C= E (3, p) = (p+3) mod 26
A shift may be of any amount, so that the general Caesar algorithm is
C= E (k, p) = (p + k) mod 26
Where takes on a value in the range 1 to 25. The decryption algorithm is simply
P= D (k, C) = (C - k) mod 26
Rules when using Caesar Cipher Encryption technique
If it is known that a given ciphertext is a Caesar cipher, then a brute-force cryptanalysis is easily
performed: simply try all the 25 possible keys. Figure below shows the results of applying this
strategy to the example ciphertext. In this case, the plaintext leaps out as occupying the third line.
153
References
1) Forouzan A.B. (2007). Data Communication and Networking, Fourth Edition, Alan R.
Apt
2) Mark A.D & Antoon W.R (2008). Network Fundamentals, CCNA Exploration
Companion Guide, Second Edition, Cisco Press
154