Networking Assignment...
Networking Assignment...
Networking Assignment...
nt
Subject Name: Computer Networks
Subject Code: CSE 1005
Submitted To
Ahsan Ullah
Senior Lecturer, Department of
CSE.
World University of Bangladesh
Submitted By
Ummay Somaiya
Roll - 2204
Batch - 38(A)
Dept : CSE.
Ans. to the Que. No. (01)
(i) Ans :
We Know, C = ( P + K ) mod 26
So F represent to shift 5 bits
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 18 19 20 21 22 23 24 25
7
Plain 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
text
Cipher F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
text
(ii) Ans:
We know, C = ( P + K ) mod 26
K = ( C – P ) mod 26
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Plain 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
text
Ciphe K L M N O P Q R S T U V W X Y Z A B C D E F G H I L
r text
Now,
K (K) = ( 10 – 0 ) mod 26
= 10 mod 26
= 10
=K
K (O) = ( 14 – 4 ) mod 26
= 10 mod 26
=1
=K
K (C) = ( 2 – 18 ) mod 26
= ( -16 + 26 ) mod 26
= 10
=K
K (K) = ( 10 – 0 ) mod 26
= 10 mod 26
= 10
=K
K (B) = ( 1 – 17 ) mod 26
= ( -16 + 26 ) mod 26
= 10
= K,
So, The key is ‘K’ ,K shift 10
(iii) Ans :
My First name is: “UMMAY”
Plain 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
text
Cipher 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
text
E F C T I
V N S A B
D G H K L
M O P Q R
U W X Y Z
Now we have to divide the plain letter into pair of letters
encrypting the phrase “EXAMFORINFORMATIONSECURITY”.
EX AM FO RI NF OR MA TI ON SE CU RI TY
CU VQ NW ZB GN PM QV IE WG VC EX ZB AT
Key 3 2 4 5 1
plain text W E L C O
M E T O C
O M P U T
E R N E T
W O R K S
C L A S S
Encryption Process:
The encryption procedure utilizes the Feistel structure comprising numerous rounds of handling
of the plaintext, each round consisting of a “substitution” step followed by a permutation step..
Feistel Structure is given bellow:
Decryption Process :
The process of decryption in Feistel cipher is almost similar. Instead of starting with a block of
plaintext, the ciphertext block is fed into the start of the Feistel structure and then the process
thereafter is exactly the same as described in the given illustration.
The process is said to be almost similar and not exactly same. In the case of decryption, the only
difference is that the subkeys used in encryption are used in the reverse order.
The final swapping of ‘L’ and ‘R’ in last step of the Feistel Cipher is essential. If these are not
swapped then the resulting ciphertext could not be decrypted using the same algorithm.
Description in detail how DES transform a 48 bit string into a 32 bit string using the S-BOXES are
given below:-
Diagram of S-BOXES :
For 8 S-BOXES has 8 predefine table:
For S1:
S1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7
1 0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 9
2 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0
3 15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13
For S2:
S2 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 15 1 8 14 6 11 3 4 9 7 2 13 12 0 5 10
1 3 13 4 7 15 2 8 14 12 0 1 10 6 9 11 5
2 0 14 7 11 10 4 13 1 5 8 12 6 9 3 2 15
3 13 8 10 1 3 15 4 2 11 6 7 12 0 5 14 9
For S3:
S3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 10 0 9 14 6 3 15 5 1 13 12 7 11 4 2 8
1 13 7 0 9 3 4 6 10 2 8 5 14 12 11 15 1
2 13 6 4 9 8 15 3 0 11 1 2 12 5 10 14 7
3 1 10 13 0 6 9 8 7 4 15 14 3 11 5 2 12
For S4:
S4 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 7 13 14 3 0 6 9 10 1 2 8 5 11 12 4 15
1 13 8 11 5 6 15 0 3 4 7 2 12 1 10 14 9
2 10 6 9 0 12 11 7 13 15 1 3 14 5 2 8 4
3 3 15 0 6 10 1 13 8 9 4 5 11 12 7 2 14
For S5:
S5 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 2 12 4 1 7 10 11 6 8 5 3 15 13 0 14 9
1 14 11 2 12 4 7 13 1 5 0 15 10 3 9 8 6
2 4 2 1 11 10 13 7 8 15 9 12 5 6 3 0 14
3 11 8 12 7 1 14 2 13 6 15 0 9 10 4 5 3
For S6:
S6 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 12 1 10 15 9 2 6 8 0 13 3 4 14 7 5 11
1 10 15 4 2 7 12 9 5 6 1 13 14 0 11 3 8
2 9 14 15 5 2 8 12 3 7 0 4 10 1 13 11 6
3 4 3 2 12 9 5 15 10 11 14 1 7 6 0 8 13
For S7:
S7 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 4 11 2 14 15 0 8 13 3 12 9 7 5 10 6 1
1 13 0 11 7 4 9 1 10 14 3 5 12 2 15 8 6
2 1 4 11 13 12 3 7 14 10 15 6 8 0 5 9 2
3 6 11 13 8 1 4 10 7 9 5 0 15 14 2 3 12
For S8:
S8 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 13 2 8 4 6 15 11 1 10 9 3 14 5 0 12 7
1 1 15 13 8 10 3 7 4 12 5 6 11 0 14 9 2
2 7 11 4 1 9 12 14 2 0 6 10 13 15 3 5 8
3 2 1 14 7 4 10 8 13 15 12 9 0 3 5 6 11
Each S-BOX takes 6 bits as input and gives 4 bits as output. There are total 8 S-BOXES. That
means total input bits are 48 bit and total output bits are 32 bit.
Let, 100100 are first six bit for S-BOX 1, first bit (1) & last bit (0) are represent row of S1 and 4
bits (0010) of middle represent column of S1.
If 100100 take S-BOX 1 as input it will give 14 in decimal number which is the value of 2 nd row
and 2nd column of S1 as output which in binary form in 4 bits is 1110.
So, if 100100 is the input for S1, the output is 1110.
Example:
Let the input bits are:
111011 010101 101010 110011 010101 100010 110110 001100 where 1110011 for S1, 010101
for S2, 101010 for S3 and so on.
For 111011,
Since the first and last bit represent row, so here the row number is 3(11), and column number
is 13(1101).
So, the output is 0, in binary 0000.
For 010101,
Row = 1(01)
Column = 10 (1010)
Output = 1 = 0001
For 101010,
Row = 2(10)
Column = 5(0101)
Output = 15 = 1111
For 110011,
Row = 3(11)
Column = 9(1001)
Output = 4 = 0100
For 010101,
Row = 1(01)
Column = 10(1010)
Output = 15 = 1111
For 100010,
Row = 2(10)
Column = 1(0001)
Output = 14 = 1110
For 110110,
Row = 2(10)
Column = 11(1011)
Output = 8 = 1000
For 001100,
Row = 0(00)
Column =6(0110)
Output = 11 = 1011
1,022-200 = 822
1,022-180 = 842
1,022 - 50 = 972
characteristics of OSPF:
OSPF is a link-state protocol in which all routers in the routing domain exchange information
and thus know about the complete topology of the network. Because each router knows the
complete topology of the network, the use of the SPF algorithm creates an extremely fast
convergence. Other key characteristics of OSPF are as follows:
Provides routing information to the IP section of the TCP/IP protocol suite, the most
commonly used alternative to RIP.
Sends updates to tables only, instead of entire tables, to routers.
Is a more economical routing protocol than RIP over time because it involves less
network traffic.
OSPF is usually more efficient than RIP in exchanging routing information when a network is
stable; however, for this rule to hold true, it depends on network events. For example, during
an external convergence event, OSPF could flood more traffic than RIP. Consider that RIP carries
25 routes per update; on the other hand, OSPF floods a single LSA per external route that is
affected by the convergence event. So, provided that you have a (relatively) stable
environment, OSPF involves less traffic, and over time, it is statistically more economical than
RIP. Using a single LSA per external route is inefficient, but OSPF was never designed to be an
EGP. Therefore, OSPF/BGP deployment when large numbers of external routers are present.
Another popular type of dynamic routing protocol that is based on the Dijkstra SPF algorithm is
IS-IS. The use of IS-IS versus OSPF has been hotly debated.
Given,
IP address: 180.100.0.0/16.
‘A’ has 32 customers; each needs 256 addresses.
‘B’ group has 128 customers; each needs 128 addresses.
‘C’ group has 128 customers; each needs 64 addresses.
‘D’ group has 32 customers; each needs 32 addresses.
So Ip needed-
32*256=8192
128*128=16384
128*64=8192
32*32=1024
Total = 33792
Ip: 180.100.0.0/16.
180.100.0.0/16 is B class ip.
216=65536
Ip Need =33792
Available = 31744
Block size :
214=16384
213=8192
210=1024
So Ip distributing,
B = 180.100.0.0/18. – 180.100.63.255/18
A =180.100.64.0/19 – 180.100.95.255/19
C = 180.100.96.0/19 – 180.100.127.255/19
D = 180.100.128.0/22 – 180.100.131.255/22
Sub block
(a) Ans:
Access Control List: An Access Control List (ACL) is a set of rules that is usually used to filter
network traffic. ACLs can be configured on network devices with packet filtering capatibilites,
such as routers and firewalls
Almost all network security systems operate by allowing selective use of services. An ACL or
Access control list is a common means by which access to and denial of services is controlled.
On network devices such as Routers and firewalls, they act as filters for network traffic, packet
storms, services and host access. Most of these devices come with standard or default ACL and
allow for custom ACL's.
Name of ACL
Standard ACL
Extended ACL
(b)Ans:
Differentiating between Supernetting and Subnetting:
BASIS FOR SUBNETTING SUPPERNETTING
COMPARISON
Basic A process of dividing a network A process of combining small
into subnetworks. networks into a larger network.
Mask bits are moved Right of the default mask. Left of the default mask.
towards
Procedure The number of bits of network The number of bits of host
addresses is increased. addresses is increased.
Implementation VLSM (Variable-length subnet CIDR (Classless interdomain
masking). routing).
Purpose Used to reduce the address To simplify and fasten the routing
depletion. process.
(c)Ans:
Differentiating between IPV4 and IPV6.
IPV4 IPV6
IPv4 has 32-bit address length IPv6 has 128-bit address length
It Supports Manual and DHCP address It supports Auto and renumbering address
configuration configuration
In IPv4 end to end connection integrity is In IPv6 end to end connection integrity is
Unachievable Achievable
It can generate 4.29×109 address space Address space of IPv6 is quite large it can
produce 3.4×1038 address space
Security feature is dependent on application IPSEC is inbuilt security feature in the IPv6
protocol
Address representation of IPv4 in decimal Address Representation of IPv6 is in
hexadecimal
In IPv4 checksumfield is available In IPv6 checksumfield is not available
IPv4 has header of 20-60 bytes. IPv6 has header of 40 bytes fixed
(d)Ans:
Administrative Distance: A network can use more than one routing protocol, and routers
on the network can learn about a route from multiple sources. Routers need to find a way to
select a better path when there are multiple paths available. Administrative distance number is
used by routers to find out which route is better (lower number is better). For example, if the
same route is learned from RIP and EIGRP, a Cisco router will choose the EIGRP route and stores
it in the routing table. This is because EIGRP routes have (by default) the administrative
distance of 90, while RIP route have a higher administrative distance of 120.
You can display the administrative distance of all routes on your router by typing the show ip
route command:
In the case above, the router has only a single route in its routing table learned from a dynamic
routing protocols – the EIGRP route.
Routing Metric: If a router learns two different paths for the same network from the same
routing protocol, it has to decide which route is better and will be placed in the routing table.
Metric is the measure used to decide which route is better (lower number is better). Each
routing protocol uses its own metric. For example, RIP uses hop counts as a metric, while OSPF
uses cost.
The following example explains the way RIP calculates its metric and why it chooses one path
over another.
RIP has been configured on all routers. Router 1 has two paths to reach the subnet 10.0.0.0/24.
One path is goes through Router 2, while the other path goes through Router 3 and then Router
4. Because RIP uses the hop count as its metric, the path through Router 1 will be used to reach
the 10.0.0.0/24 subnet. This is because that subnet is only one router away on the path. The
other path will have a higher metric of 2, because the subnet is two routers away.
Static NAT: Static NAT (Network Address Translation) is one-to-one mapping of a private IP
address to a public IP address. Static NAT (Network Address Translation) is useful when a
network device inside a private network needs to be accessible from internet.
Dynamic NAT: Dynamic NAT can be defined as mapping of a private IP address to a public IP
address from a group of public IP addresses called as NAT pool. Dynamic NAT establishes a one-
to-one mapping between a private IP address to a public IP address. Here the public IP address
is taken from the pool of IP addresses configured on the end NAT router. The public to private
mapping may vary based on the available public IP address in NAT pool.
PAT: Port Address Translation (PAT) is another type of dynamic NAT which can map multiple
private IP addresses to a single public IP address by using a technology known as Port Address
Translation.
Router A Router B
172.168.1.32/28 172.168.1.64/28
172.168.1.48/28 172.168.1.80/28
172.168.1.128/28 172.168.1.96/28
172.168.1.144/28 172.168.1.112/28
172.168.1.160/28 172.168.1.192/28
172.168.1.176/28 172.168.1.208/28
Step 2: - Write the network ID, broadcast ID, CIDR value, subnet mask and block size of each
route.
Router A
Router B
Router A
Router B
Step 4: - Summarize each group of sequential routes in a single or multiple summarized routes.
As we can see in above figure, there are two groups of sequential routes in this router.
In first group, there are two sequential routes; 32 and 48. Both routes have a block size of 16.
The sum of block sizes is 32 (16+16). 32 is a valid block size. The network ID of first sequential
route is 32 which is a valid network ID in block size 32 (0, 32, 64,…). Block size 32 is associated
with CIDR value /27. Let’s use this block size for summarization.
Summarize the routes 172.168.1.32/28 and the route 172.168.1.48/28 in a single route
172.168.1.32/27 of block size 32.
In second group, there are 4 sequential routes 128, 144, 160 and 176 of block size 16. The sum
of all block sizes is 64. 64 is a valid block size. Network ID of first sequential route (128) is also in
the range of block size 64 (0, 64, 128, 192 ……). Thus, we can use the block size 64 to summarize
these routes. CIDR value of block size 64 is /26. Let’s use it to summarize these routes.
Supernetting (Router B)
This router also has the two groups of sequential routes. In first group there are 4 sequential
routes 64, 80, 96 and 112 of block size 16 and in second group there are 2 sequential routes
192 and 208 of block size 16.
The sum of block sizes is 64 (16+16+16+16) in first group and 32 (16+16) in second group. Both
64 and 32 are valid block sizes and the network ID of first sequential route in both groups is also
a valid network ID in both block sizes.
Summarize the routes 172.168.1.192/28 and the route 172.168.1.208/28 in a single route
172.168.1.192/27 of block size 32.