5332 - File - Network Lecture Week 6 - Audio
5332 - File - Network Lecture Week 6 - Audio
“Network Protocols”
Cont..
Remember:
Frame structure
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.
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
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:
Network ID Host ID
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.
Network ID Host ID
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.
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:
𝑺𝟏 𝑺𝟑
𝑺𝟐
“Registration” “Department”
“Control”