Chapter 4
Chapter 4
Infrastructure Protocols
IPV4
IPV6
Identification
URIs
Data Protocols
MQTT / CoAP
IP V4 – A Quick Recap
Class A
• This class is meant for a very huge network.
• In this IP address class, first octet can be from 1 to 126.
• It means there can be 126 networks possible with Class A. The first bit of
first octet will always be set to zero.
• The Remaining 24 bits (3 octets) represent the host ID. With this class there can be (2
^ 24)-2)) IP addresses.
• It is close to 17 million hosts per network.
• So, it is overt that this class IP will be used by large networks.
Contd.,
• 127 is used as a loop back address which is used for trouble shooting purpose. This means that
it is used by the host computer to send a message back to itself. It is commonly used for
troubleshooting and network testing. The ping has been done with 127.0.0.1.
• Here in the calculation (2 ^ 24)-2)), -2 is done as 1st and 255th are meant for network id and
broadcast id respectively.
Class B
This class is used for multicasting. Class D, in first its first octet has first bit as 1,
second bit as 1, third too is 1 and the 4th bit is 0. The addresses start with 224 and
ends with 239.
Class E
Class E IP addresses are used for experimental purposes only. Like Class D, it is
different from the first three classes. It has a first bit value of 1, second bit value of 1,
third bit value of 1 and fourth bit value of 1.
Protocol Format
IP Version Number: It is half a byte field (4 bits) which indicates which version of IP
is being utilized. Here the discussion is fully on Version 4. So this field has the value 4
in binary (0100). The basic idea of using this version field is to ensure the compatibility
between the versions of IP that might be used in network.
Internet Header Length: This length specifies internet header length in 32 bit
words, and points to the beginning of the data. Minimum value for a correct header is
5. (0101)
Contd.,
Type of service: This is an eight bit field which indicates on the quality of service.
QoS can be precedence, delay and reliability
Delay - This is the 4th bit and it
indicates the delay. If it is ‘0’
then it indicates the normal
delay and ‘1’ indicates a lower
delay.
Throughput – ‘0’ indicates
Reliability - ‘0’ normal delay and ‘1’
indicates the normal indicates high throughput.
reliability and ‘1’
indicates the high
reliability.
Contd.,
Total Length – This is a 16 bit field which defines the length of the IPV4 datagram.
Thus length includes header and data. Minimum length of the IP datagram is 20 bytes
and the maximum can be 65,535 bytes (2 ^ 16 = 65535).
Identification – This is an identification aid added by sender to help in assembling
the fragments.
This is a 16 bits field.
Helps in organizing data.
If the message sent is too large to fit in one packet, it will be then spilt to multiple child
packets.
To identify them all there will be a unique identifier for all the spilt packets. This makes the
receiver’s job easier to rebuild the received data.
Contd.,
Fragment offset - When fragmentation of a message occurs, this field specifies the
offset, or position, in the overall message where the data in this fragment goes. It is
specified in units of 8 bytes (64 bits). The first fragment has an offset of 0.
Time to Live- This is an 8 bit field and this indicates the time that IP datagram should
survive. There will be a time set and that will be decremented by 1 and router will be
having an eye on it. When it reaches zero the datagram can be discarded.
Protocol – This will serve as an identifier for the higher layer protocol carried in the IP
datagram. The protocols can be ICMP, IGMP, TCP or UDP. Figure 5.8 reveals few of the
protocols used for this field along with Hex code.
Contd.,
Padding - Internet Protocol Options field may vary in length. So the Padding field
provides additional zero bits so that the total header length is an exact multiple of 32
bits.
How can someone get to know the MAC address in a windows machine?
Let us go to IP V6 Now!
It has come to overcome the difficulties faced with IPV4.
IP V6 - version 6, is also named as the next generation protocol for the internet
It also works in Layer 3 (No different from the V4)
Has more addresses and multiple features to appreciate.
Contd.,
As conveyed a little earlier, IP addresses are the main problem with IPV4. It is just 4
bytes wide and it provides room for 2^32 unique IP addresses which are getting
exhausted now due to extensive usage of them.
IPV6 provides support for 2^128 unique IP addresses, a substantial increase in number
of computers that can be addressed with the help this scheme.
So…
2. Traffic Class - 8 bits - An 8-bit field that provides the means of identifying different
classes or priorities of IPv6 packets. It replaces the TOS field of IPV4.
MSB 6 bits are used for Type of Service to let the Router Known what services should be
provided to this packet.
LSB 2 bits are used for Explicit Congestion Notification
4. Payload length -16 bits - Identifies the length of the IPv6 payload (the rest of the
packet following the IPv6 header). It is used in the place of Total Length of IPV4.
5. Next header - 8 bits - This is similar to the protocol field in IPV4 header. It
represents the type of extension header that follows the primary IPV6 header.
6. Hop limit - 8 bits - TTL (Time To Live) is being replaced by Hop Limit in IPV6 header.
The value in this field is decremented by one every time the packet passes through a
host that forwards the packet. When the value reaches zero, the packet will be
discarded.
7. Source Address - As in IPV4, this specifies the sender's IP 128 bit address.
8. Destination Address - Again it is similar to IPV4. The destination's IP address is
denoted here.
Contd.,
IPv4 addresses are simple which are composed of 32 bits, and represented as 133.78.21.56 where decimal
representation is used and period (.) is used as a separator. This is different with IPV6.
IPv6 addresses are 128 bits long, written in hexadecimal, and separated by colons. An example would be:
3ffe:1900:4545:3:200:f8ff:fe21:67cf
Colons separate 16-bit fields. Leading zeros can be omitted in each field as can be seen above where the
field :0003: is written :3:.
In addition, a double colon (::) can be used once in an address to replace multiple fields of zeros.
For example:
fe80:0:0:0:200:f8ff:fe21:67cf can be written as fe80::200:f8ff:fe21:67cf.
Rather than simply suppressing the leading zeros, you can get rid of all of the sequential zeros and
replace them with two colons. The two colons tell the operating system that everything in between
them is a zero.
IPV6 can also be written in IPV4 format. An instance would be 10.122.132.10 can be represented
as ::ffff:10.122.132.10.
URI (Universal Resource Identifier) /
URL / URN
URI – Sequence of characters – used to identify resources.
Resources can be Logical or Physical.
Guidelines issued by IETF – Internet Engineering Task Force.
Let us make this understanding clearer! URI Has URN / URL in it . Means, URL / URN are babies of the mother
URI.
URIs tries this: identifying a resource through a name and to provide a means of locating the
resource by describing its primary access mechanism.
Also, this is a cute definition: URN defines an item’s identity, whereas URL renders a method for finding it.
Lets get deeper – URL first.
All what I talk is based on ”RFC 3986 - Uniform Resource Identifier (URI)”
What is RFC? Folks, you must know it!
URL Has information about how to fetch / acquire a resource from its location.
Note the following:
URLs always begin with a protocol. (Most obvious, HTTP)
It will have the details about the host name
It will have the path.
A URL is used when a client is raising a request to the server for the service.
An example follows:
URN – Uniform Resource Name
A resource is identified through a name. But, remember this, it will not tell you how to
spot it / locate it on the internet.
There is a prefix URN for all the URNs.
When you specify "access mechanism, location" and URI becomes URL.
urn:vehiclenumber:0451450523 to identify a vehicle by its vehicle number.
Summary:
URIs are identifiers, and that can mean name, location, or both.
URNs and URLs are URIs, Vice versa is not correct.
URL is the combination of the name and an access method, such as https://,
or mailto:.
Let us summarize… With the
identification
URL: ftp://ftp.is.co.za/rfc/rfc1808.txt
URL: http://www.ietf.org/rfc/rfc2396.txt
URL: ldap://[2001:db8::7]/c=GB?objectClass?one
URL: mailto:[email protected]
URL: news:comp.infosystems.www.servers.unix
URL: telnet://192.0.2.16:80/
URN (not URL): urn:oasis:names:specification:docbook:dtd:xml:4.1.2
Ref: Stack overflow
Lets learn more!