You are on page 1of 13

Lovely Professional University

Department of CA

HOMEWORK-4

Homework Title/No: 4 Course Code: CAP 306

Course Instructor: Lect. Amandeep mam Course Tutor (if applicable): NA

Student’s Roll Number: RD3912A10 Section No.: D3912

Declaration:

I declare that this assignment is my individual work. I have not


copied from any other student’s work or from any other source except where due
acknowledgement is made explicitly in the text, nor has any part been written for
me by another person.

Student’s Sign:
Baninder kaur

Evaluator’sComments: ___________________________________________________

Marks obtained ____________ out of __________________

PART A

1. Classify the following addresses into class A, B, C, D or E:

1. 197.18.10.201
2. 170.78.90.121
3. 248.172.16.109
4. 11001100.00001111.10101010.00000011

A:-
 197.18.10.201 :- Class C

 170.78.90.121 :- Class B

 248.172.16.109 :- Class D

 11001100.00001111.10101010.00000011 :- 204.15.170.3 :- Class C

2. Which is better classless addressing or classful addressing?


Explain with examples.

A:- CLASSLESS ADDRESSING


Classless addressing, or CIDR (Classless Internet Domain Routing), defines
arbitrarily-sized subnets solely by base address and number of significant bits in the
address.

 A CIDR address of 192.168.0.0/24 defines a block of addresses in the range


192.168.0.0 through 192.168.0.255, while 192.168.0.0/20 would define a
network 16 times as large - from 192.168.0.0 through 192.168.15.255.

Example of classful routing protocols is :-

1. RIP V1
2. IGRP

Classless is also called IP subnetting. It divides classful network addresses into smaller
networks (subnet).

In classful addressing scheme, a 32 bit address is divided into Network ID and Host ID
in 8-bIt boundary:

- Classless IP allows more left bits for network ID (and fewer bits for host ID). The
number of bits used by network ID is called network mask. For example, a.b.c.d/m says
"network ID is the leftmost m bit."
Consider this example: A network has 100 computers to be connected to Internet. They
are using a class C network 200.1.2.0/24. Then the network grows to 500 computers.

 It needs a class B network, say 150.1.0.0/16. However, 150.1.0.0/16 covers


65,536 class B IP addresses. This network only uses 500 of them. 65,036 IP
addresses are wasted.
 This causes the shortage of IP address due classful addressing scheme's fixed
networ/host boundary.
 This problem can be solved by classless addressing. For example, 150.1.0.0/23
allows 512 host ID. It covers addresses 150.1.0.0~150.1.1.255).

CLASSFULL ADDRESSING

Classful addressing refers to addresses as assigned as blocks - Class A, B, C, D, or E.

o Class A block addresses always start with a leftmost bit of 0 and and addresses in
the range 0.0.0.0 to 127.255.255.255.
o Class B addresses start with the bits 01 and are in the range 128.0.0.0 -
191.255.255.255
o Class C addresses start with the three bits 110 and are within the range 192.0.0.0 -
255.255.255.223
o Class D, with starting bits 1110 and within 224.0.0.0 and 239.255.255.255 is
reserved for multicast address.
o Class E (the remainder) start with bits 11110 and range from 240.0.0.0 to
255.255.255.255 and are reserved.

Example of classless protocol :-


RIP V2
EIGRP
OSPF

CLASSLESS VS CLASSFULL

The difference between classful IP addressing and classless IP addressing is in selecting


the number of bits used for the network ID portion of an IP address. In classful IP
addressing, the network ID portion can take only the predefined number of bits 8, 16, or
24. In classless addressing, any number of bits can be assigned to the network ID.

An IP address is broken down into a network part and a host part.

For example, the IP address 35.2.3.1 is classified as class A because the first octet of 35
falls in the range of class A addresses. Class A addresses generally have the first octet as
the network part and the next three octets as the host part giving us a default network
mask of 255.0.0.0 or /8

If this is the case the IP address is classful and originally all IP addresses were
classful only. The shortage of IP addresses made way for classless addressing.
In reality, Class addresses are converted to Classless for routing through the Internet,
since BGP4 is used across the Internet backbone.

For example, a router may have an interface attached to the 10.1.5.0/24 network. It
may also have routes from a routing protocol, also for the 10.x.x.x network.

The Main Problem With "Classful" Addressing

A key weakness of regular subnetting is low “granularity”. A Class B address block


contains a very large number of addresses (65,534) but a Class C block has only a
relatively small number (254). There are many thousands of “medium-sized”
organizations who need more than 254 IP addresses, but a small percentage of these need
65,534 or anything even close to it.

Additionally, the router itself can operate either “classfully” or “classlessly” when
actually routing data. When a “classful” router has an interface connected to a major
network, it believes it knows all routes connected to that major network.

Since many people are used to looking at IP address blocks in terms of their “classful”
sizes, it is common to express CIDR address blocks in terms of their “classful”
equivalents. First of all, it should be simple at this point to see that a CIDR “/8” network
is equal in size to a Class A network; a “/16” is equivalent to a Class B; a “/24” is
equivalent to a Class C. This is of course because Class A networks use 8 bits for the
network ID, Class Bs use 16, and Class Cs use 24.

In a classless environment, we completely change how we look at IP addresses, by


applying VLSM concepts not just to one network, but to the entire Internet.

“Today routers route both classful and classless protocols. For example, RIP is
classful, and both BGP4 and IS-IS is classless but classless is much better than
classfull”

3. In symmetric key cryptography how many keys are needed if


Alice and Bob want to communicate with each other.

A:- In symmetric-key cryptography, we encode our plain text by mangling it with a


secret key. Decryption requires knowledge of the same key, and reverses the mangling.

ciphertext = encrypt( plaintext, key )


plaintext = decrypt( ciphertext, key )
Symmetric key cryptography is a class of algorithms where Alice and Bob share a
secret key.These algorithms are primarily used to achieve confidentiality, but may also
be used for authentication, integrity and limited non-repudiation.

In the symmetric key cryptography a single key is used in bidirectional communication .


If Alice and Bob want to communicate with each other a secret key encryption
/decryption the same key is used by both the parties.

To use a symmetric algorithm for confidentiality, Alice transforms a plaintext


message to ciphertext using a symmetric algorithm and a key.

 Alice transmits the ciphertext to Bob. Bob uses the same key to transform the
ciphertext back into the plaintext.
 Symmetric algorithms can also be used to authenticate the integrity and origin of
data.
 Alice uses her key to generate ciphertext for the entire plaintext, as above.
 She sends the plaintext and a portion of the ciphertext to Bob. This portion of the
ciphertext is known as a message authentication code, or MAC.
 Bob uses his copy of the key to generate the ciphertext, selects the same portion
of the ciphertext and compares it to the MAC he received.
 If they match, Bob knows that Alice sent him the message.
 This does not provide non-repudiation, though. Alice can deny sending the
message, since Bob could have generated it himself.

Alice and Bob need to share a symmetric key before Alice encrypts or generates a MAC
for a message. Establishing that shared key is called key management, and it is a
difficult problem.
To use symmetric cryptography, Alice and Bob need to share a secret. Once
Alice and Bob share a symmetric encryption key, the algorithm can be used to
establish additional shared secrets.

PART B

1. In a symmetric key cryptography, if person in a group of 10


people needs to communicate with every other person in another
group of 10 people, how many secret keys are needed?

A:- In order to calculate the no of secret keys for person in a group of 10 people who
needs to communicate with every other person in another group of 10 people we use
the following:-

n * (n-1)/2

The no of secret keys required are:-

n * (n-1)/2

10*(10-1)/2 =>45

2. Find the block of address assigned to your organization or


institution.

A:- The Internet Assigned Numbers Authority (IANA) has reserved the
following three blocks of the IP address space for private internets:

10.0.0.0 - 10.255.255.255 (10/8 prefix)


172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

An Organisation that decides to use IP addresses out of the address space defined in this
document can do so without any coordination with IANA or an Internet registry. The
address space can thus be used by many enterprises. Addresses within this private
address space will only be unique within the enterprise, or the set of enterprises which
choose to cooperate over this space so they may communicate with each other in their
own private internet.

The organization network is connected to the Internet via a router. The router has two
addresses. One belongs to the granted block. The other belongs to the network that is at
the other side of the router.

Consider the following example:-


• Each site could have up to 50 host connections.
• The customer had already assigned IP addresses to some of the servers and site
PC's on the local LAN's.

The IP address given to this organisation was 146.162.0.0 (which is a Class B address),
and the decision was made to use the whole of octet 3 for the subnet addresses leaving
octet 4 for the host addresses.

 This made assigning IP addresses more easy to carry out and gave a
maximum of 254 hosts per subnet and there could be a maximum of 254
subnets, thus satisfying the customer's requirements.
 The subnet mask for each subnet (Whether LAN or WAN) was
consequently 255.255.255.0, it is important to design the addressing
scheme such that the subnet mask is common to all LAN's/WAN's
throughout the network unless a routing protocol such as OSPF is to be
used. OSPF allows variable subnet masking.

Suppose an organization is granted the block 130.56.0.0/16. The administrator


wants to create 1024 subnets. So, the block of address for such organisation is:-

a) 255.255.255.192 will be the subnet mask

b) 62 valid addresses can exist in each subnet


c) First address in subnet 1 will be 130.56.0.1 and last address is sibnet 1 will be
130.56.0.62

d) First address is 1024 subnet will be 130.56.255.193 and last address in 1024 subnet
will be 130.56.255.254

If an organisation has an IP Address:- 190.87.140.202/29

Then its block address would be:-

202----> 128+64+0+0+8+0+2+0

The leftmost 5 numbers are:-

128+64+0+0+8

The first address is = 190.87.140.200/29

The no. of addresses is 8

The last address is = 190.87.140.207/29

There are only 28 addresses in this block.

3. Some people argue that we can consider the whole address space
as one single block in which each range of addresses is a subblock
to this single block. Elaborate on this idea .What happens to
subnetting if we accept this concept?

A:- We can consider the whole address space as one single block, but there exists
some problems as:-

• Network becomes too large and complex


• Involves limited network
• Non centralised network
• Complex routing process

So, in order to resolve these problems, subnetting is introduces as:-

o The routing process becomes much simplified by using subnets.


o Subnet hides the internal; networks numbers by just giving out the main
number to the routers.
o The routing tables become much shorter by using the Subnet addresses
and this means that the data flow also becomes faster.
o By using Subnet addresses the entire IP address system becomes
centralized. he network administrators can assign IP numbers to specific
departments in an organization so that when they can easily identify the
departments on the network using the same numbers. Subnet also divides
the bigger network into smaller individual networks and it becomes easy
to handle the smaller networks than handle one huge network.
o Also it removes physical barriers and since the networks now are
individually identified all the networks can be connected through routers.

Suppose a company receives an address block within the internet from an ISP. The
ISP designates it by communicating two values to the company:

Suppose those values are:

1) 141.14.0.0
2) 255.255.0.0

The network lies at 141.14.0.0 within the internet-- on a scale of 0.0.0.0 to


255.255.255.255. That's at about the 55% mark from beginning to end of the global
address number line ( 141/256 = 55% ).

The network consists of 65536 addresses. That's because its netmask consists of sixteen 1
bits followed by sixteen 0 bits. The number of 0 bits, specifically how many you can
count with them, determines the size of the block.

And sixteen bits gives countability from 0 to 65535. This precisely defines the network
that the company bought.
Most companies want to subdivide the addresses they get from an ISP, to parallel
their existing organizational subdivisions and to permit routing patterns by internal
routers among such subdivisions and sublocations.

 Suppose the company would prefer to split up their large pool into some smaller
ones.
 There are many possible ways to slice it. Maybe 2 subnets of 32768 each. Or
8192 subnets of 8 apiece. Or 1 subnet of 32768 plus another 128 subnets of 256.
 As an example let the company define 3 subnets, each 256 in size.
Subnetting allows you to create multiple logical networks that exist within a single
Class A, B, or C network. If you do not subnet, you are only able to use one network
from your Class A, B, or C network, which is unrealistic.

The company would now apply its addresses differently, by using them together with the
new netmask value 255.255.255.0. The command form they would use to configure
workstation interfaces would now be, for example:

netmask 255.255.255.0

“So, subnetting is introduced in order to subdivide a large network and making a


centralised network, which is better than considering the whole address space as
one single block in which each range of addresses is a subblock to this single block.”

You might also like