0% found this document useful (0 votes)
32 views20 pages

5332 - File - Network Lecture Week 6 - Audio

This document summarizes key aspects of network protocols: 1. It describes the frame structure used in networking, including the MAC header, IP header, TCP/UDP header, data, and CRC. 2. It provides details on the TCP header fields including source/destination ports, sequence numbers, flags, window size, checksum, and options. 3. It outlines the main fields in the IPv4 packet header like version, header length, TTL, protocol, checksum, and IP address classes. 4. It explains concepts like IP subnetting, private IP address spaces, and how subnets divide networks into groups.

Uploaded by

Mohamed Gamal
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)
32 views20 pages

5332 - File - Network Lecture Week 6 - Audio

This document summarizes key aspects of network protocols: 1. It describes the frame structure used in networking, including the MAC header, IP header, TCP/UDP header, data, and CRC. 2. It provides details on the TCP header fields including source/destination ports, sequence numbers, flags, window size, checksum, and options. 3. It outlines the main fields in the IPv4 packet header like version, header length, TTL, protocol, checksum, and IP address classes. 4. It explains concepts like IP subnetting, private IP address spaces, and how subnets divide networks into groups.

Uploaded by

Mohamed Gamal
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/ 20

Chapter – 3

“Network Protocols”
Cont..
Remember:

Frame structure

MAC IP TCP or UDP Part of Data CRC


Header Header
20 (TCP) 20 byte 46 to 1500 byte 16 or
6 byte
byte (UDP) 8 byte 32 bits
TCP Header (20 Bytes Total)
 Source Port used to identify application run in the source.

 Destination Port used to identify required action from destination.

Port 23: Telnet remote login service, unencrypted


 Sequence number is segment number used for data reassembly at destination.
 Acknowledgement number contains the value of the next sequence number the sender
of the segment is expecting to receive.
 Header length – sometimes TCP header length is greater than 20 byte due to option
field which may extend header length with additional 4 byte.
 Control bits – purpose and function of TCP segment

There are six flags in the TCP header. One or more can be turned on at the same time.
URG The URGENT POINTER field contains valid data
ACK The ackowledgement number is valid
PSH The receiver should pass this data to the application as soon as possible
RST Reset the connection
SYN Synchronize sequence numbers to initiate a connection.
FIN The sender is finished sending data.
 Window size –16 bit field contains the size of the receiving window of the sender. It advertises
how much data (in bytes) the sender can receive without acknowledgement. Thus, window size is
used for Flow Control. It is important to note that window size changes dynamically during data
transmission. Where it usually increases during TCP transmission up to a point where congestion
is detected. After congestion is detected, the window size is reduced to avoid having to drop
packets.

 Checksum – Used for error checking of segment header and data by logic operation that makes
sure that length of header and data is multiple of 32 bit. The operation is one's complement of the
one's complement sum of all 16 bit words in the header and text). If the result is odd number, this
means that segment length is odd multiple of 16 bits. This is a mandatory field that must be
calculated and stored by the sender, and then verified by the receiver.
 Options with size varying from 0 bytes to 40 bytes generally used for the following purposes:

A. Time Stamp:
When wrap around time is less than life time of a segment, multiple segments having the same
sequence number may appear at the receiver side. This makes it difficult for the receiver to identify
the correct segment. If time stamp is used, it marks the age of TCP segments, receiver can identify
the correct segment.
B. Window Size Extension:
If the receiver wants to receive more data (large window with size needs more than 16 bits) , it can
advertise its greater window size using this field.
C. Parameter Negotiation:
Example- During connection establishment, both sender and receiver have to specify their maximum
segment size.
D. Padding:
When header length is not a multiple of 4, extra zeroes are padded in the Options field.
IPv4 Packet Header
 Version: Tells us which IP version we are using, only IPv4 uses this header so you will always
find decimal value 4 here.

 Internet Header Length: This 4 bit field tells us the length of the IP header in 32 bit
increments. The minimum length of an IP header is 20 bytes so with 32 bit increments, you
would see value of 5 here. The maximum value we can create with 4 bits is 15 so with 32 bit
increments, that would be a header length of 60 bytes.

 Differentiated Services (DS): This is used for QoS (Quality of Service). There are 8 bits that
is used to mark the packet with a certain treatment. .

 Time-to-Live (TTL): Limits the lifetime of a packet – decreased by one at each router along
the way.

 Protocol: Used to identify the next level protocol. TCP has value 6 and UDP has value 17.
 Total Length: this 16-bit field indicates the entire size of the IP packet (header and data) in
bytes. The minimum size is 20 bytes (if you have no data) and the maximum size is 65.535
bytes, that’s the highest value you can create with 16 bits.

 Identification: If the IP packet is fragmented then each fragmented packet will use the same 16
bit identification number to identify to which IP packet they belong to.

 IP Flags: These 3 bits are used for fragmentation:

 The first bit is always set to 0.

 The second bit is called the DF (Don’t Fragment) bit and indicates that this packet should
not be fragmented.

 The third bit is called the MF (More Fragments) bit and is set on at all fragmented
packets except the last one.
 Fragment Offset: Sometimes number of fragments is too large to be counted by

16 bits. In this case, this 13 bit field is used as extension for fragment ID.

 Header Checksum: this 16 bit field is used to store a checksum of the header. The

receiver can use the checksum to check if there are any errors in the header.

 IP Option: used for network testing, debugging, security, and more. This field is

usually empty.
IP Address Classes
1- Class A:
8 bits 8 bits 8 bits 8 bits

Network ID Host ID

 Total number of networks = 28 , each network contains 224 − 2 hosts

 We subtract 2 from host addresses since all 0’s and all 1’s addresses are reserved for
broadcasting and NIC test.

 Network mask for Class A: 255 . 0 . 0 . 0 or using prefix after writing the address such as:
(170 . 85 . 150 . 25 / 8) here ( /8 ) is called network prefix which means that network mask
contains 8 ones or length of network ID part = 8 bits.
 Private Address Space : 10. 0. 0. 0 to 10. 255. 255. 255
2- Class B:

8 bits 8 bits 8 bits 8 bits

Network ID Host ID

 Total number of networks = 216 , each network contains 216 − 2 hosts

 Network mask for Class B: 255 . 255 . 0 . 0 or using prefix after writing the address such
as: (170 . 85 . 150 . 25 / 16) here ( /16 ) is called network prefix which means that network
mask contains 16 ones or length of network ID part = 16 bits.

 Private Address Space : 172. 16. 0. 0 to 172. 31. 255. 255


3- Class C:

8 bits 8 bits 8 bits 8 bits

Network ID Host ID

 Total number of networks = 224 , each network contains 28 − 2 hosts

 Network mask for Class C: 255 . 255 . 255 . 0 or using prefix after writing the address
such as: (170 . 85 . 150 . 25 / 24) here ( /24 ) is called network prefix which means that
network mask contains 16 ones or length of network ID part = 24 bits.

 Private Address Space : 192. 168. 0. 0 to 192. 168. 255. 255


Class D (Network ID from 224 – 239):
(Reserved for multicast)

Class E (Network ID from 240 – 255):


(Reserved for experimental, used for research)
IP Subnetting

 Inside the same network, hosts can be divided into groups called subnets.
 Subnet ID is part of host ID from left.
 In case of subnetting, prefix includes network ID + subnet ID so that will not equal to
multiple of 8
 For example, consider class C IP, then subnetting could be configured as follows:

Network ID Subnet ID Host ID

8 bit 8 bit 8 bit 8 bit


8-b b

Where: b is the length of host ID


 Example:
Consider network IP: 192. 168. 64. 0/ 24 to be used as private IP in modern academy, it is required to
divide hosts into 3 groups (subnets): Registration group (50 host) – control group (28 hots) –
department group (12 hots). For each group find; first IP, last IP, broadcast IP, IP mask and prefix.

𝑹 "𝟏𝟗𝟐. 𝟏𝟔𝟖. 𝟔𝟒. 𝟎 / 𝟐𝟒"

𝑺𝟏 𝑺𝟑
𝑺𝟐
“Registration” “Department”
“Control”

... ... ...

50 host 28 host 12 host


Solution:
1- Registration group (50 host)
2𝑏 − 2 ≥ 50 ⟹ 𝑏 = 6 𝑏𝑖𝑡𝑠 ⟹ max. number of hosts inside this subnet = 26 − 2 = 62 ℎ𝑜𝑠𝑡
⟹ subnet ID length = 8 − 6 = 2 bit
 Prefix = 32 − 6 =/26
 Subnet mask: 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 0 0 0 0 0 0 = 255. 255. 255. 192
 Subnet IP: 192. 168. 64. 0 / 26 = 192. 168. 64. 0 0 0 0 0 0 0 0 / 26
 First IP: 192. 168. 64. 1 / 26 = 192. 168. 64. 0 0 0 0 0 0 0 1 / 26
 Last IP: 192. 168. 64. 62 / 26 = 192. 168. 64. 0 0 1 1 1 1 1 0 / 26
 Broadcast IP: 192. 168. 64. 63 / 26 = 192. 168. 64. 0 0 1 1 1 1 1 1 / 26
Solution:
2- Control group (28 host)
2𝑏 − 2 ≥ 28 ⟹ 𝑏 = 5 𝑏𝑖𝑡𝑠 ⟹ max. number of hosts inside this subnet = 25 − 2 = 30 ℎ𝑜𝑠𝑡
⟹ subnet ID length = 8 − 5 = 3 bit
 Prefix = 32 − 5 =/27
 Subnet mask: 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 0 0 0 0 0 = 255. 255. 255. 224
 Subnet IP: 192. 168. 64. 64 / 27 = 192. 168. 64. 0 1 0 0 0 0 0 0 / 27
 First IP: 192. 168. 64. 65 / 27 = 192. 168. 64. 0 1 0 0 0 0 0 1 / 27
 Last IP: 192. 168. 64. 94 / 27 = 192. 168. 64. 0 1 0 1 1 1 1 0 / 27
 Broadcast IP: 192. 168. 64. 95 / 27 = 192. 168. 64. 0 1 0 1 1 1 1 1 / 27
Solution:
3- Department group (12 host)
2𝑏 − 2 ≥ 12 ⟹ 𝑏 = 4 𝑏𝑖𝑡𝑠 ⟹ max. number of hosts inside this subnet = 24 − 2 = 14 ℎ𝑜𝑠𝑡
⟹ subnet ID length = 8 − 4 = 4 bit
 Prefix = 32 − 4 =/28
 Subnet mask: 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 0 0 0 0 = 255. 255. 255. 240
 Subnet IP: 192. 168. 64. 96 / 28 = 192. 168. 64. 0 1 1 0 0 0 0 0 / 28
 First IP: 192. 168. 64. 97 / 28 = 192. 168. 64. 0 1 1 0 0 0 0 1 / 28
 Last IP: 192. 168. 64. 110 / 28 = 192. 168. 64. 0 1 1 0 1 1 1 0 / 28
 Broadcast IP: 192. 168. 64. 111 / 28 = 192. 168. 64. 0 1 1 0 1 1 1 1 / 28

You might also like