OSI Layer 3 I - Network Layer

 This article is in a final form but it needs to be reviewed.  -> NETWORK LAYER   -> provides connectivity between end hosts on different networks -> provides logical addressing -> provides quality of service -> provides path selection between source and destination (routing) -> See Routing - in depth for details -> encapsulation, a segment with a L3 header added is called a "packet" -> example protocols: IPv4, IPv6 (communication), ICMP (diagnostics), OSPF (routing) -> considers the MTU and splits packets based on it. -> MTU -> Maximum transmission unit -> the maximum size of a layer 3 packet that can be sent over the medium -> also understood as the maximum data payload a frame (l2 packet) can transport -> for example an ethernet frame has a maximum size of 1518 bytes which means the MTU is 1500 -> if the frame is 802.1Q tagged then its maximum size increases to 1522 bytes. The MTU stays the same. -> however the minimum payload of a frame can drop from 46 bytes to 42 bytes if 802.1Q tag is used. -> an L3 device cand split up a packet if its size exceeds the MTU of a medium (for example when a packet travels over multiple mediums with different MTUs) -> IP -> Internet Protocol -> IP (v4 and v6) are the principle L3 protocols. -> provides the means of host to host communication -> other L3 protocols (like ICMP, OSPF) use the IP protocol. -> characteristics -> connectionless -> no dedicated connection between hosts. -> the packet is just sent towards an address. -> best effort -> unreliable, IP cannot guarantee that the packets will be delivered -> IP has no methods of verifying the availability of the destination -> media independent -> IP is not dependent on the transmission medium (radio, copper, light). -> types -> IPv4 -> Fields -> VERSION (4 bits) -> set to binary 0100 (decimal 4) -> identifies the version of the IP protocol as 4 (IPv4) -> Internet Header Length (4 bits) -> DS (8 bits) -> called Type of Service (ToS) -> determines the priority of each packet -> split in -> DSCP (6 bits) Differentiated services code point (which replaces the 3 bit IP Precedence field) -> ECN (2 bits) Explicit Congestion Notification -> Total Length (16 bits) -> the size of the entire packet in bytes -> Identification (16 bits)  | -> Flag (3 bits)		      | -> fields used when the packet is fragmented by a router due to the MTU. -> Fragment Offset (13 bits) |    Routers use these fields to keep track of the fragments. -> TIME-TO-LIVE (8 bits) -> a value which decreases by one each time a router processes a packet -> when it reaches 0 the packet is dropeed and an ICMP message is sent to the source IP address. -> PROTOCOL (8 bits) -> Identifies the next level protocol (the header which follows the IP header) -> examples: ICMP (1), TCP (6), UDP (17) -> HEADER CHECKSUM (16 bits) -> detects corruption in the IPv4 header. -> recalculated by each router because the TTL decrements. -> used together with Internet Header Length and Total Length to validate the packet. -> SOURCE IP ADDRESS (32 bits)      | -> DESTINATION IP ADDRESS (32 bits) | -> see "IPv4 Address, IPv6 Address and Subnetting.txt" for details -> Options and Padding. -> Limitations -> there are 4 billion possible -> 4,294,967,296 (2^32) -> the actual number of public IP addresses is smaller due to reserved IP addresses. -> lack of end-to-end connectivity -> due to NAT -> Increased network complexity -> due to the NAT (like additional latency) -> IPv6 -> Fields -> VERSION (4 bits) -> set to binary 0110 (decimal 6) -> identifies the version of the IP protocol as 6 (IPv6) -> TRAFFIC CLASS (8 bits) -> equivalent of IPv4 DS field -> FLOW LABEL (20 bits) -> all packets with the same flow label receive the same type of handling by the routers. -> PAYLOAD LENGTH (16 bits) -> the length of the payload of the IPv6 packet. -> doesn't include the header (fixed 40 bytes size) -> NEXT HEADER -> identifies the data payload type the packet is carrying. -> equivalent of IPv4 Protocol -> HOP LIMIT -> equivalent of IPv4 TTL -> IPv6 header doesn't include a checksum, which needs to be recalculated each time the Hop Limit is decreased. -> SOURCE IP ADDRESS (128 bits)      | -> DESTINATION IP ADDRESS (128 bits) | -> see "IPv4 Address, IPv6 Address and Subnetting.txt" for details -> Advantages -> increased address space -> 2^128 -> simplicity -> fewer fields -> no need for NAT Terms and explanations: -> DMZ -> demilitarized zone -> the DMZ is a part of a company's network which contains resources available to the internet (public network) -> devices in the DMZ use public addresses -> the DMZ is basically a public addresses subnet. -> it is characterized by the fact that it allows the internet users to initiate connections