On LAN (local area network) nodes can communicate with each other through their physical MAC addresses.This works well on small scale because switches can quickly learn the MAC addresses connected.

IP address: 32bit numbers made up of four octets and each octet is normally described in decimal numbers.

example: 12.34.56.78 is a valid ip address 123.456.789.100 is not

above format is known as dotted decimal notation.

IP addresses are distributed in large sections to various organizations and companies instead of being determined by hardware vendors. This means IP addresses are more hierarchical and easier to store data about than physical addresses are.

IP addresses belong to networks, not to the devices attached to those networks. Your laptop will always have the same MAC address no matter where you use it, but i’ll have a different IP address assigned to it at an internet cafe than it would when you’re at home.

For now, remember that on many modern networks, you can connect a new device and an IP address will be assigned to it automatically through a technology knkown as DHCP Dynamic Host Configuration Protocol. An IP address assigned this way is known as a dynamic IP address.

The opposite of this is known as a static IP address. which must be configured on a node manually. In most cases, static IP addresses are reserved for clients. But there are certainly situations where this might not be true

IPv4 Datagram and Encapsulation

Packet is usually referred to as an IP datagram.

IP datagram: highly structured series of fields that are strictly defined.

Untitled

The two primary sections of an IP datagram are the header and the payload. You’ll notice that an IP datagram header contains a lot more data than an ethernet frame header does. The very first field is four bits and indicates what version of protocol is being used. The most common version of IP is version 4 or IPv4.

Version 6 or IPv6 is rapidly seeing more widespread adoption after the version field we have header length field.

Header length field declares how long the entire header is. This is almost always 20 bytes in length when dealing with IPv4. In fact 20 bytes is the minimum length of an IP header. You couldn’t fit all the data you need for a properly formatted IP header in any less space.

Service type field - specify details about quality of service or QoS technologies.

The most important takeaway about QoS is that there are services that allow routers to make decisions about which IP datagram maybe more important than others.

Total length field - Indicates total length of the IP datagram it’s attached to.

Identification field - A 16-bit number that’s used to group messages together

IP Datagram have a maximum size and since total length field is 16 bit 2^16 would give 65535. If the total amount of data that needs to be sent is larger than what can fit in a single data gram the IP layer needs to split this data up into many individual packets. When this happens, the identification field is used so that the receiving understands that every packet with the same value in that field is part of the same transmission.