0% found this document useful (0 votes)
10 views25 pages

Problems

Uploaded by

studentmicrsft
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views25 pages

Problems

Uploaded by

studentmicrsft
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Problem Solving on Subnetting, Fragmentation and

Error Detection Technique-Cyclic Redundancy


Check
Author
Kavita A.Kathane
Assistant Professor

Department of Computer Science & Engineering

Yeshwantrao Chavan College of Engineering


(An Autonomous Institution affiliated to Rashtrasant Tukadoji Maharaj Nagpur University)
Hingna Road, Wanadongri, Nagpur - 441 110
CONTENT

Sr. No. Name of Topic Slide No

1 Problems on Subnetting 4

2 Exercise on Subnetting 10

3 Problems on Fragmentation 11

4 Exercise on Fragmentation 17

5 Problems on Cyclic Redundancy Check 18

6 Exercise on Cyclic Redundancy Check 22

2
GENERAL OBJECTIVE

The student will be able to:


Understand the Concept of Subnetting, IP Addressing and
ability to solve the Subnetting problems.

 Understand the Concept of Fragmentation and ability to solve


the Fragmentation problems
Understand the Concept of CRC, binary division and ability to
solve the CRC problems.

3
LECTURE 1:- PROBLEMS ON SUBNETTING

Problem 1:
Calculate the number of subnets required for the IP address
20.0.0.0. Also write the Subnet IDs required and Broadcast
ID for the network shown in the diagram.
Solution:
1. Given IP Address is 20.0.0.0.
It is a Class A address,
which has 8 Network bits
and 24 host bits.

2.Write details IP Address with


host bits
20.00000000.00000000.00000000

4
LECTURE 1:- Problems on Subnetting
3. Maximum number of Subnet ID required
2n>=60, as largest number of end system is the network is 60.
For n=6, we get
26-2>=60
64-2>=60
62>=60
Hence n=6, i.e. maximum number of subnet required.

4. Keep 6 bits of host and give remaining bits to the network.


i.e.
20.00000000.00000000.00000000

5. Reserve 6 bits for host


20.11111111.11111111.11000000

6.Convert this IP to Decimal


20.255.255.192

5
LECTURE 1:- Problems on Subnetting
Subnet IDs and Broadcast IDs:
7. Default Subnet Mask for Class A
is 255.0.0.0. Subnet ID 1: 20.0.0.0/26
Broadcast Id: 20.0.0.63
8.8. After Subnetting Default
subnet Mask will be Subnet Id 2: 20.0.0.64/26
255.255.255.192 Broadcast Id:20.0.0.127
As n=6, we require six subnet IP
addresses Subnet Id 3: 20.0.0.128/26
Broadcast Id:20.0.0.191

Subnet Id 4: 20.0.0.192/26
Broadcast Id:20.0.0.255

Subnet Id 5: 20.0.1.0/26
Broadcast Id: 20.0.1.63

Subnet Id 6: 20.0.1.64/26
Broadcast Id:20.0.1.127

6
LECTURE 1:- PROBLEMS ON SUBNETTING

Problem 2:
Determine the number of subnets required for the given
network and the IP address 15.0.0.0. Write the Subnet IDs
and Broadcast IDs required.

Solution:
1. Given IP Address is
15.0.0.0. It is a Class A
address, which has 8 Network
bits and 24 host bits.

2. Write details IP Address


with host bits
15.00000000.00000000.00000000

7
LECTURE 1:- Problems on Subnetting
3. Maximum number of Subnet ID required
2n>=1024, as largest number of end system is the network is 1024.
For n=11, we get
211-2>=1024
2048-2>=1024
2044>=1024
Hence n=11, i.e. maximum number of subnet IDs required.

4. Keep 11 bits for the host and give remaining bits to the network.

5. Reserve 6 bits for host


15.11111111.11111000.00000000

6. Convert this IP to Decimal


15.255.248.0

7. Default Subnet Mask for Class A is 255.0.0.0


After Subnetting Default subnet Mask will be 255.255.248.0.
8
LECTURE 1:- Problems on Subnetting
From the diagram given, we require 5 Subnet IDs and 5 Broadcast IDs as
follows:-
Subnet ID 1: 15.0.0.0/21
Broadcast Id: 15.0.7.255

Subnet ID 1: 15.0.8.0/21
Broadcast Id: 15.0.15.255

Subnet ID 3:15.0.16.0/21
Broadcast Id: 15.0.23.255

Subnet ID 4: 15.0.24.0/21
Broadcast Id: 15.0.31.255

Subnet ID 5: 15.0.32.0/2
Broadcast Id: 15.0.39.255

Subnet ID 6: 15.0.40.0/21
Broadcast Id: 15.0.47.255

9
LECTURE 1:- Exercise on Subnetting
10 1. Calculate the number of
subnets required for the
given network and the IP
address 193.168.10.0.
30 R1 R2 24 Write the Subnet IDs and
Broadcast IDs required.

60 120

10

2. Calculate the number of


subnets required for the
given network and the IP
address 190.162.0.0. Writ e 30 R1 R2 360
the Subnet IDs and
Broadcast IDs required.
.
60 120

10
LECTURE 2:- Problems on Fragmentation
Problem 1
A datagram of 4000 bytes (60 bytes of IP header + 3940 bytes of payload)
arrives at router and must be forwarded to a link with an MTU of 1500
bytes. Find how many fragments will be generated and also give the values
of MF field, offset, and total value for all.

Solution:
Given-
Datagram = 4000 bytes = 60 Bytes (IP header) + 3940 Bytes (Data)

MTU= 1500Bytes = 60 B + 1440B

Number of fragments = 3940 Bytes/1440 Bytes


= 2.73
= 3 (Take Upper Value)

11
LECTURE 2:- Problems on Fragmentation

No of fragments will be generated and also give the values of MF field,


offset, and total value for all.
MF=0 If no packet is arriving after
MF=1 if packet is arriving after

Offset How many no of data bytes are ahead.

Total
Fragments MF Offset
Length

P1 1440+60 1500 1 0 0

P2 1440+60 1500 1 1440/8=180 180

P3 1060+60 1120 0 1440+1440=2880/8=360 360

12
LECTURE 2:- Problems on Fragmentation
Problem 2:
A datagram of 3000 bytes (20 bytes of IP header + 2980 bytes of payload)
arrives at router and must be forwarded to a link with an MTU of 500 bytes.
Find how many fragments will be generated and also give the values of MF
field, offset, and total value for all.

Solution:
Given-
Datagram =3000 bytes = 20 Bytes (IP header) + 2980 Bytes (Data)
MTU= 500Bytes = 20 B + 480B

Number of fragments = 2980 Bytes/480 Bytes


= 6.20
= 7 (Take Upper Value)

13
LECTURE 2:- Problems on Fragmentation

No of fragments will be generated and also give the values of MF field,


offset, and total value for all.
MF=0 If no packet is arriving after
MF=1 if packet is arriving after

Offset How many no of data bytes are ahead.


Total
Fragments MF Offset
Length
P1 480+20 500 1 0 0
P2 480+20 500 1 480/8=60 60
P3 480+20 500 1 480+480=960/8=120 120
P4 480+20 500 1 480+480+480=1440/8=160 160
P5 480+20 500 1 480+480+480+480=1920/8=240 240
P6 480+20 500 1 480+480+480+480+480=2400/8=300 300
360
P7 100+20 120 0 480+480+480+480+480+480=2880/8=360

14
LECTURE 2:- Problems on Fragmentation

Problem 3:
A datagram of 4000 bytes (20 bytes of IP header + 3980 bytes of payload)
arrives at router and must be forwarded to a link with an MTU of 1500
bytes. Find how many fragments will be generated and also give the values
of MF field, offset, and total value for all.

Solution:
Given-
Datagram =4000 bytes = 20 Bytes (IP header) + 3980 Bytes (Data)
MTU = 1500Bytes = 20 B + 1480B
Number of fragments = 3980 Bytes/1480 Bytes
= 2.68
= 3 (Take Upper Value)

15
LECTURE 2:- Problems on Fragmentation

No of fragments will be generated and also give the values of MF field, offset, and

total value for all.

MF=0 If no packet is arriving after

MF=1 if packet is arriving after

Offset How many no of data bytes are ahead.

Fragments Total Length MF Offset

0
P1 1480+20 1500 1 0
185
P2 1480+20 1500 1 1480/8=185
370
P3 1020+20 1040 0 1480+1480=370/8=370

16
LECTURE 2:- Exercise on Fragmentation
1. A datagram of 4000 bytes (60 bytes of IP header + 3940 bytes of
payload) arrives at router and must be forwarded to a link with an MTU
of 1000 bytes. Find how many fragments will be generated and also give
the values of MF field, offset, and total value for all.

2. A datagram of 3000 bytes (20 bytes of IP header + 2980 bytes of


payload) arrives at router and must be forwarded to a link with an MTU
of 1000 bytes. Find how many fragments will be generated and also give
the values of MF field, offset, and total value for all.

17
LECTURE :- 3 Problems on CRC
Problem 1:
Consider the Cyclic Redundancy Check (CRC) based error detecting
scheme having the generator polynomial X3+X+1. Suppose the
message bits are 110000 is to be transmitted. Calculate the value of
check bit sequence appended at the end of the message bits by the
transmitter. Receiver will receive the data bits without error; verify
whether the received bits are error free or not.
Solution:
Given
Original Message=110000
Generator Polynomial= X3+X+1
Therefore,
CRC Generator= 1X3+0X2+1X1+1X0= 1011 4-bit
As CRC generator is of 4 bit, 3 zeros will be appended to the original
message
Therefore, 110000000 will become the message
Now, perform division .

18
LECTURE :- 3 Problems on CRC

At Sender Now, append the last three bits of


1011 110000000
remainder with original data, and
XOR 1011
send it to receiver. And perform the
XOR 011100000
1011 same division at the end of receiver.
XOR 01010000
At Receiver
1011

XOR 0001000 1011 110000011


1011 XOR 1011
Remainder 0011 XOR 011100011
1011
XOR 01010011
1011
As the remainder is all zeros,
XOR 0001011
it shows that there is no 1011
change in data bits sent by
Remainder 0000
sender. Data is error free.

19
LECTURE :- 3 Problems on CRC
Problem 2: Consider the following message M = 1010001101. Calculate the
cyclic redundancy check (CRC) for this message using the divisor polynomial
x5 + x4 + x2 + 1.
Solution:
Original Message=1010001101
Generator Polynomial= x5 + x4 + x2 + 1
Therefore,

CRC Generator= 1X5 +1X4 +0X3+1X2 +0X1+ 1 =110101  6-Bits


As CRC generator is of 6 bit, 5 zeros will be appended to the original
message.

Hence,
M= 101000110100000 will be the message.
Now, perform division

20
LECTURE :- 3 Problems on CRC
At Sender
110101 101000110100000 Now, append the last five bits of
XOR 110101 remainder with original data, and send it
XOR 011101110100000 to receiver. And perform the same
110101
division at the end of receiver.
XOR 101000110100000 M=1010001101001110
110101
At Receiver
XOR 011101110100000
110101 101000110101110
110101
XOR 110101
XOR 00111010100000 XOR 011101110101110
110101 110101
XOR 001111100000
110101 XOR 00111010101110
XOR 0010110000 110101
110101 XOR 001111101110
XOR 01100100 110101
110101
XOR 0010111110
0001110
110101
Remainder 001110
XOR 01101010
As the remainder is all zeros, it shows that 110101

there is no change in data bits sent by sender. XOR 0000000

Data is error free. Remainder 000000

21
LECTURE :- 3 Exercise on CRC
1. Consider the following message M = 101101. Calculate the cyclic
redundancy check (CRC) for this message using the divisor
polynomial X2+1.
2. Consider the following message M = 100100100. Calculate the cyclic
redundancy check (CRC) for this message using the divisor
polynomial X3 + X2 + 1

22
Recommended Books:

1. Computer Networking: A Top-Down Approach by Kurose and Ross


Pearson publication.

2. Computer Networks by Behrouz A., McGraw-Hill Publication.


3. Computer Networks by Andrew S. Tanenbaum, Pearson Publication.

23
References Books:

1. Computer Networks A Systems Approach by Larry Peterson Bruce Davie


Elsevier, ISBN: 9780123850591.
2. Data and computer Communication by William Stallings, Pearson Education.

24
References Website

1. GeeksforGeeks | A computer science portal for geeks


2. Tutorials List – Javatpoint
3. Subnetting in Computer Networks – javatpoint
4. Fragmentation at Network Layer – GeeksforGeeks
5. Cyclic Redundancy Check and Modulo-2 Division – GeeksforGeeks

25

You might also like