You are on page 1of 32
—____ UNIT-III NETWORK LAYER Switching : Packet Switching Internet protocol - IPV4 IP Addressing — Subnetting - IPV 3.1 NETWORK LAYER SERVICES Network layer is the third layer in OSI model. It provides end to end communication by forwarding packets from source to destination. Network layer plays functions such as: « Determination of path/ route from source to destination. « Forwarding data packets e Providing data flow. Services provided by network layer to the transport layer is referred as Network layer services. Services are : (i) Packeting (ii) Routing and forwarding (ii) Addressing (iv) Error control (v) Flow control (vi) Congestion control (vii) Quality of service In general, Network layer provides * Guaranteed delivery * Guaranteed delivery with bounded delay. Scanned with CamScanner Computer Networks 3.2 In-order packet delivery. © Guaranteed minimal bandwidth ¢ Guaranteed maximum jitter Security services. ()__ Packeting It is the process where the network layer encapsulates, (payload with a packets received from upper layer protocol and makes new packet. It is done by orl layer protocol called Internetworking Protocol (IP). Thrce main functions of network layer are ~ Packeting — Routing ~ Addressing. (ii) Routing and Forwarding Routing is the process responsible for transmitting packets from source to destination. Network layer chooses best path to transmit data. Best path is choosen based on factors such as shortest path and greatest available bandwidth. Forwarding is an action done by each router, when packet arrives to it. Forwarding process implements a forwarding table which helps to lookup for a destination of arrived packet. ( i) Addressing : Addressing enables to have unique identifier for the each device connected ina network. (iv) Error Control : Since packets in the network layer are fragmented into pieces in router, error control could not be efficient, if implemented in this layer. However, checksum field is added to find any corruption in the header point of payload. ICMP (Internet Control Message Protocol) takes care of this job. (v) Flow control : It controls the amount of data being transmitted without blocking or congesting any of the participating node ina network, Reasons for lack of flow control in network layer are : - Lack of error control, - Upper level layers use buffers to receive - Upper layers that use services o} with flow control, data from network layers. f network layer were implemented Scanned with CamScanner Network Layer a (vi) Congestion control: Congestion oceurs when sender sends data beyond the receiver limit. Congestion is an overloaded condition in a network. Congestion can be,avoided by allocating resources that can be adjustable by the devices connected to the network. (vii) Quality of Service (QOS) : QOS important as the network supports different types of data. (viii) Security : IPSec plays vital role in providing security to the network. 3.2 PACKET SWITCHING In Data Communication, switching techniques divided into two broad categories : (i) Circuit switching (ii) Packet switching Packet switching is the process of transferring packets in form of packets in a network. Data is broken into sized chunks of data, added with header portion and transmitted in the network. It is a connectionless network switching technique. Header | Payload [Heda [Payoea . Packet e Header contains address details of packet. e Payload contains the actual data. Packets are always not sent in the same path, so recording of packet must be done at the destination side. Packet switching employs store and forward technique, Advantages of packet switching Efficient utilisation of bandwidth. ° ¢ Minimal transmission delay, More reliable and fault tolerant. Allows simultaneous use of same channel by multiple users. © — Robustness of link. Scanned with CamScanner Computer Networks 34 Disadvantages ¢ «Have high installation costs. / hat cannot afford delay: (ex) high quality voice 4 Not suitable for applications, th calls. Need to add sequenc! ¢ number to reorder packet at destination side. re more processing power: 4 Switching nodes requir pes of packet switehing : Different ty] There are 2 different approaches in packet switching: @ Connectionless service ~ Datagram approach. oriented service — Virtual circuit approach. witching : (Datagram approach) hing contain full address which includes source (ii) Connection (i) Connectionless packet s Each packet in datagram packet switel and destination address. Each packet is treated independently, without relationship between packets belonging to the same message. Routers are used to transmit d it lata between sourct inati in thi approach is normally referred as datagrams. Sand degtnaton. Packets in his Figure Datagram Packet Switching The above fi . igure d message to reach the d epicts the path taken by th ¢ destination (ex) Internet. ¥ the four packets belor Ing to the same Scanned with CamScanner network Layer 35 The datagrams arri the source. The routers d address. ‘ives at the destination with different order from the order sent by lecide the route for the packet based on the source and destination Internet use datagram approach at the network layer. Forwarding packet is decided based on the destination address. | advantages : | (i) Can decide link by their own. Failure of one link can be replaced by other link. | (ii) No additional time required for connection set up and connection tear down. (iii) Store and forward mechanism help at times of packet loss or link failure. Disadvantages : (i) Extra processsing power needed to connect devices. (ii) Packet delivery is not guaranteed, so no reliability. (iii) Different types of delay takes place, since it works on store and forwards. Delays in packet switching : e Transmission delay © Propagation delay © Queing delay e Processing delay Connection oriented packet switching : (Virtual Circuit Approach) Before transmission of data, a virtual connection need to be established between source and destination is known as connection oriented service. It overcomes the drawback of packet loss in connectionless packet switching approach. it also overcomes the drawback of circuit switching, which takes dedicated full it for a single connection. Individual packets of same message doesnot take different path as in connectionless ice, Instead, it takes the selected path by source-destination pair from a set of lefined paths. Itis called virtual, because the circuit isnot real and dedicated to a source-destination Scanned with CamScanner Computer Works pS is created and allocated for , i i th ID Based on source-destination (SD) pair, @ pal particular session. tween source and destination, bet n ¢ of ta ing is better than connectionless For larger volum: ; connection oriented packet switch' packet switching. Virtual circuit ID is provided by routers to uniquely identify the path. It is also irtual cit s known as Virtual Circuit Identifier. Connection oriented service works on three phase process : « — Setup «Data transfer «Tear down Setup phase In this phase, router creates a virtual circuit. Address information only transferred during setup phase. A 4j3[2]4] 7 x! X )RS Eblels] B x x = 7 MIs 2217) naam Es i Ra » R2, R3, R4 and RS are routers Figure Virtual packet switched network, During setup phase, vi We ef P phase, virtual path is established by usi t y using two packets, Acknowledgement packet Request packet i ou is set from s i “ ce to destination, Source A sends reque; Packet to router quest packs RI. Source A und lerstands packet 80es through Port 3, Scanned with CamScanner network Layer 37 The router assigns label (ID) as 14, and outgoing port 3. The router then forward packet through port 3 to router R3. Fig. Request packet _ Router R3 receives setup request packet. Enters incoming port, label 66 and outgoing port3 in forwarding table. 4 « — Router R4 receives setup request packet. Enters incoming port 1, incoming label 22 and outgoing port 4. « Destination B receives setup packet. If it is ready to receive assign label 77. (Labels 66, 22 and 77 are assumptions) Acknowledgement packet completes the switching table entry by filling the 4th entry in forwarding routing table. Destination B sends acknowledgement packet to A, through router R4, R3 and RI. E After receiving acknowledgement, connection is established between source and the destination. Data transfer phase: During data transfer phase, packets belonging to one message is sent from the source and destination through the selected path, Tear down phase : a Sender, after sending all available packets to destination sends a tear down packet ie nation to terminate the connection, Destination node on receiving tear down packet, ‘nds a confirmation packet to terminate the connection, Y Scanned with CamScanner Computer Networks 38 3.3. NETWORK LAYER PERFORMANCE | based on the following factors/metries, k layer is measu Performance of a networ » Delay © Throughput e Packet loss © Congestion control iol i travel from si he additional taken by a bit of data to tr piesa The delay defines th destination. There are 4 types of delay : Transmission delay «Propagation delay «Processing delay © Queuing delay Transmission delay : Transmission delay is the time between last bit of message reaching the destination to the first bit of message reached the destination. It is denoted by delay. Distance Delay, = Transmission rate Propagation delay : Itis the time taken for a bit to travel from sourc inati i i ¢ to destination. The propagation delay depends on the propagation speed of medium. It is of 3 x 10" m/s ina aia and much less for wired medium, It is denoted by Delay ny! Delay = Distance Ld Propagation speed Processing delay : Itis the time taken by i ! y A router to receive a i ime to re framinseriee Packet. It consider ti i ket fon mt Port, remove header, Perform error detection roced| e vet packet Port (router) or deliver packet to the destination po i haat rt, It is denoted as P Scanned with CamScanner Delay, = Time a packet waits in input queue and output queue of a router. | network Layer 39 Queuing delay : Each router maintains input queue connected to input port (packet arrival) and output queue connected to output port (packet waiting to be transmitted.) The queuing delay for a packet is the time a packet waits in the input queue and | output queue of a router. (ex) Busy airport, where fight wait for landing and departure. It jg denoted as Delay’, | | Total delay a packet encounters is computed by sum of all the delay. If there are n nodes ina network. then it will have (1v+1) links, | | | Total delay = (n+1) (Delay, + Delay,, + Delay,,) + (n) (Delay, Throughpw Throughput is defined as the number of data packets transmitted per second. ‘Throughput measures the performance and quality of a network. Network throughput is ‘based on the factors like physical channel, packet loss and congestion in network. It is denoted by TR. If there are n links, on which packet has to travel to reach destination, then Throughput = minimum (TR,, TR,»....-TR,} Packet loss : Non receipt of sent packet at the destination is termed as packet loss. It occurs due totransmission errors or congestion in network. (overflow of buffer). The causes of packet are high latency, bandwidth, jitter, hardware/software failure and so on. Lost packet be recovered by packet retransmission, gestion control : Congestion control improves the performance of a network load (packet size)and ughput are inversely proportional to each other. When load increases beyond the capacity of network, then throughput decreases. en load is minimum, throughput increases, Congestion at network layer is based on two issues : © Throughput * Delay __ Packet size (load) and delay are directly proportional to one another. When load is inimum, delay will be Scanned with CamScanner 3.10 Computer Netwrje propagation delay and processing delay. Minimum delay composed of queing delay: When delay increases, it includes Throughput Delay congestion = No , /congestion | congestion + LoaaiCapacity Throughput Vs Load Delays Vs Load LoadiCapaciy Figure Congestion - Delay & Throughput ‘There are two broad categories of congestion control mechanism : (i) Open loop congestion control (controls congestion before it happens) (ii) Closed loop congestion control (controls congestion after it happens) (i) Open-loop congestion control : In open-loop congestion control mechanism, several approaches are carried to prevent congestion. Congestion control is performed by either source or destination.) Different approaches of open-loop congestion control are : «Retransmission policy «Window policy * Acknowledgement policy Discarding policy * Admission policy, Retransmission policy : Normally sei . . But tee retransmits the packet during packet loss or transmission errors. Fee a ee oer the ‘hetwork, So proper retransmission policy am ; her must be designed to improve the perform fF network by preventing congestion. ance of netw Window policy : ee ee pln is far better than the Go-back-N window. Selective repea! i ; , packet, mprove the performance by sending only the lost or corrupte Scanned with CamScanner network Layer 341 ‘cknowledgement policy : Acknowledgement on every successful delivery of packet induce congestion on network. So, receiver can avoid sending acknowledgement for all the packets received. Moreover sending acknowledgement for N packets and corrupted packets improve the performance of network and prevent the congestion. Discarding policy : Discarding noisy/corrupted packet also prevent congestion. Admission policy : Admission policy also referred as Quality of Service (QOS) mechanism. In this approach, switches and routers disallow the heavy load packets and thus prevent congestion. Routers can also deny establishment of virtual connection, when there is a possibility of congestion in future transmission. (i) Closed loop congestion control : In closed loop congestion control, several mechanisms are carried to alleviate (control) congestion after it happens. Different approaches are : «Back pressure e Choke packet «Implicit signalling e Explicit signalling Back pressure : In back pressure approach, the congested node stops receiving data from immediate upstream node or nodes. It is a node to node congestion control mechanism. __ This back pressure approach is applied only to virtual circuit network. (i.e.) Nodes which know the upstream node from where the data comes) but not to the datagram network connectionless network.) < Back Back Pressure Pressure Pressure Figure Back Pressure IFR3 is congested, it stops receiving from R2 and informs R2 to slow down. R2 Bets congested, so stops receiving data from R1 and informs RI to slow down and continues the same. intun Scanned with CamScanner oY 3.12 Computer Neto Choke packet : In choke packet, whenever a node is congested, itdirectly sends the warning Mesa called choke packet to the source node. Intermediate nodes does not get any Wang message. In back pressure, congestion warning is sent from congested node to upstream node whereas in choke packet is directly sent from congested node to source node. Congested Choke Packet node (X) (x) E=| ©—_©—= Dataflow Figure Choke packet Implicit signallin, In implicit signalling, no separate warning message is sent to intimate the occurrence of congestion. Sender on non-receiving of ack for receive packet, concludes congestion in network and slows down the rate of sending data. No participating nodes involvedia sending warning message. Explicit signalling : In explicit signalling, whenever node feels congestion, it sends a congestion sign! along with the data packet. No separate warning message is sent to alert the congestio But it includes alert signal of congestion being occurred in the data packet itself. 3.4 IPV4 Addresses An IP (Internet Protocol ) address is a unique address used to identify a device it network. There are two types of IP addressing ; (i) IPV4 (ii) IPV6 Address space : Address space is total number of discrete address used by the protocol. Scanned with CamScanner network Layer | IPV4 is made up of 32 bits ; cabs gubnet mask. ded into network and host portion with the help of The 32 bits are divided in t 4 0 decimal that is seperated by dot TOetets, eae h of 8 bits. Each octet is represented in ). Each octet range from 0 to 255 decimal. Ex : 128.0. *: 8.0.0.1 (or) 1000000.00000000.00000000.00000001 Example of binary octet convert to decimal: Piri [p Ix2= | Vale og Ix2= 4 Ix2= 8 Ix2*= 16 1x25= 32 1x25= 64 1x27= 128 255 Address can be represented in three notations : (i) Binary notation (ii) Dotted decimal notation (iii) Hexadecimal notation. Binary 10000000 00001011 00000011 ooOOtIN Dotted Decimal t ' 1 . i . { Hexa Decimal, . 80 0B 03 \F 32 bits IP Address Defines Network Defines node Scanned with CamScanner Computer Networ salled classty * J by Keeping prefix as fixed Ten rength of prefix i termed as classless addressing. 3.4.1 Classful Addressing ing is a network addressing scheme used during the introduction of P addressing sana newer sare common nnworkprefis aNd HOGS EME eg to have a unique host number. To support different network size, IP address space i , class A, B,C, D and E. ach las fixes ided into 5 classes like voundary between network size and host number. Oy 5, SH FH, cuss | profes _| Fiat ye cass a [Prete a | n-eoe | otorer cs 8 [70 Prt B | n=tovis | s20t0101 cass ¢ [110 Prefe | anzabis | 1s2t0zz cass 0 [170 Muriast accesses 1D [Notappicati| 22810 200 Gass E | 1111 Reserved for future use E [Not applicable) 240 to 255 sux] <—— 2 __, pace incasstl addressing, Class J its is used as network identifier (0); belongs to class A. 2”= 128 network in the world have class A address Class B n= 16 bits, prefix =2 ident i = 16, 384 networks in the world Wi Class C : bits, prefix (110), belon; = ), belongs to class C. By defa 2"'= 2,097,152 networks in the world will says ee ee cus? cus classA | 0 Tn this no prefix or Suffix, Itis used for No prefix or suffix. Addresses start with st address, belongs to class E. Zt ate Netwa ‘Host 27 = 128 network ID 2! —2= 16,777.214 host 1D Ixxx to 126x232. iabt tee — et * cwss8 [1 0 | Network Host Class C Class D Class & 2! = 16384 network ID 2! — 2 = 65534 host ID 128.0.xx - 191.255-xx. abit abt, 22! = 2097152 network ID 28-2 = 254 host ID 192,0.0x - 223255255 abit 0 Host | 224,0.0.0 - 239.235.255.255 2ebi Host 285.255.255.254 224,0.0.0 - Bas, Scanned with CamScanner Computer 1 yo Host 1D = ‘etamust be unique « InHost ID, cannot be set 10 2670 OF OME Network ID = by network ID. ts connected to same network are identifies art with 127, because itis reserved FOr internal gg Class A. to one are reserved for broadcast address, ‘of network ID, set sett 0", dente a specified host on Tocal network and cannot fy Problems with classfal addressing = Number of Class A, Class B address are wasted (Address depletion) Number of Class C address is small, that it couldnot satisfy the need: ‘© Class D used for multicast are available as single block only. Class E address are reserved. the class ofthe address. ‘© Use of subnetting and supernetting. 3.4.2 Classless Addressing To overcome the drawbacks of el i naan neane te deracsote lassful addressing, it is replace by Classless It length blocks are sth blocks are used, that belong to no classes. This is referred The number of address in a block needs to be power of 2 A organisation ca eanisation can be granted with one block of address Beck] [Boake]. +» [Boose Figure. Address space, ese su contiguous sub blocks. ‘network called subnetting. fo reduce waste of IP address ina block, subneting is used Class A-255.0.0.0 Class B -255.255.0.0 Class C -255.255.255.0 ye [4] aq — Prete oooh Slash pyte |-] byte |-] bite |- Figure CIDR - Slash notation When nis provided we can retrieve, number of ares, first adress and last address block. «Number of address in block N=2"* address, keep n leftmost bts and set (32-0) rightmost ss, keep n leftmost bits and set (32-n) rightmost BSS © Tofind fit © To find last addre TANA (Internet Assigned Number Authori®) Scanned with CamScanner 5C. So, 2°= 25 IP, hence 56 wasted he problem incl Jess addressing. Paddress can be obtained irresp, yested number of IP add is overcome by class! ‘exact number of l In classless addressing. for IP address, requ whenever user asks Brock Networly etwork when provided classes. That be provided in blocks. th IP addres } 2° IP address are present. Rules for forming CIDR block 1. All the IP address shoul i ldress should be contiguous. (continuing of IP address should 2. Block size should always power of 2. (find b is easy, whenevt! > find block number (tag) is easy, IFBlock 43, First IP address in the block shouldbe ev any binary number divisible by 32 ses Ateopeseorc oe at beck bays zro's are maitained in ‘These three rules must be satisfied for CIDR blocks. Quest: Check whether given block is CIDR? 100.1:2.32 100.1.2.33, Satisfied, continuous IP address. 6, where 2*= 16. ible (remainder should be zero ~ Rule 1: Rule 2: Satisfy 2%, given 32 t047 ld be evenly ) by size of block. Rule 3 wn three also satisfied. Ques 150,10.20.127 Check for CIDR? Rule 1 Satisfied, continuous IP adress: mere Scanned with CamScanner Computer tv ied; n= 6 e = = 64= 24,35 Rule 2: Size ofblock n 2°: 64 t0 127 = 64 2 yes ple 3: Firat P 1501020564 vs0.10.2001 [OEOOE]o-6, 39 6 767) ed, s0 CIDR block. of CIDR Represen 12.32 - m 16 = 241P Address Host ID partis wre “and network / block ID is i 32-4 = 28bits 100.1.247 Now 100.12.32728 100.1.2.33 28 100.1.2.4728 It means block ID constitute of 28 bits and host ID is 4 bits. iddress is used for block ID, and last is used for DBA (Direct Broadcast Address). So even though there are 16 IPaddress only, only 14 IP address can be used for practical purpose Givern CIDR representation of one IP address, retrieve all IP address of a block. Given 20.10,30,35 27 for block ID and 5 bits for host 1D, bits22, 10,3035 58 8@ 20.10.30, 010 ae, 24 bit 3 bits ‘© Inthis 5 bits are host ID 27 bits ——, Block 1D 5 bit for host ID «Aggregation ¢ tage of CIDR strategy is also known as ad nown as address summar ion. When number of blocks of addr i ren routing can be done base ei oe es iB fone based on the prefix ofthe aaes s the ad posal Address 0 PVA: si this — host address (0,0.0.0/32 used by th " tig the ost. which doesn’t know its own 1d — broadcast address (255.255.255.255/3 ; 32, where host or router sent packet to all host or devices within a network.) somerset loopback address. qi (iv) Private address .3 Dynamic hest configuration protocol (DHCP) network protocol that automaticall assigns IP address toa computer configured twork. the installation «The dynamic host configuration protocol is used to simy and maintenance of networked computers. ter is connected to anetwork, DHCP can provid the into the network, €.8- 1e subnet mask, the domain © Ifanew comy necessary i addresses of a DNS server and the default router, name, and an IP address. ing an IP address, makes DHCP very a! of care-of-addresses. tive for mobile IP as a source DHCPDISCOVER ep ta Fig: Basie DHCP Config Scanned with CamScanner PDISCOVER in the exa 1g MAC broadcasts to rm 10 forward requests across a server (DI ids requests ust bbe needed send a request (0 nds. A client 5 TANTA DHCP eelay might D Server tntazation Cestocted) DHOPOISCOVER || Determine the earring pe [-BHOPOISCOVER configuration guration in DHCPOFFER DHIQROFFER sca gen £ ‘Selection of configuration g a puoprequcsT | DACPREQUEST | contrmation of (iy (options) | configuration DHCPACK la initacation fompleted 4 4 y 3. The client can now choose one of the configurations offered. The client repli the servers, accepting one of the configurations dnd rejecting others DHCPREQUEST. 4. Ifa server receives a DHCPREQUEST with a rejection, configuration for other possi is. it can free the reser! $. The server the configu . confirms should release the configu: received by the ie Server can free t the eli and offer the coniguration agin fee the context stored for guration a client gets froma as to be reconfirmed from ti ime to “cr¥et is only eased for a certain amount of . J the server wil fe the conga evan. Ti , sof erashed nodes orn out of configuration helps " odes moved away without leasing the context on aul ded to protect mobile nodes fom malicious HCP servers. ion, the mobile node ‘DH aT HCP server came emeh folate IIe age format : ic message ou Hardware type Hardware sacs o 8 / Le w est_[Opcode] Hiype | Aten [recur Hop count TransectoniD | Tine aosed a Clent Pacis t+ settoo YourlD address —t+ WP aceresssentby sever Server IP address b> Broadcast P address Gateway IP address => Address of detaut router ‘Client hardware address 1. OHGP Discover 2 DHCP Ofer Senerrare zon Boot fie nae 4. DACP Decne 5. DACP Ack teg_[ tenon |__ va 6. DACP Nack 7. DACP Release 8 DHCP Ito Transition states of DHCP DHCP assigns DHCP assig ‘ease time allocatio DHCP assigns 1e address is assigned autor location : address in three way = IP address ly tone permanently toa device work card based on MAC address. lease time) address fora period of time Scanned with CamScanner Bound state Renewing state Rebinding state Computer Neto Renew Coon rer | (DACP Request) Figure Transition state of dhcp + DHCP client broadcast DHCP discover message. Affer sending DHCP discover message, client goes to selection state. Server responds by sending DHCP OFFER and locks wit the requested IP addres DOP Ack ate, until receives DHCP ack from server ig DHCP ACK the client goes to bound state. until the lease expires. When 50% lease again sends DHCP REQUEST. Then it goes for renewing state + The client remains in renewing state under two condi + eeeives DHCP ack and renew lease agreement. DHCP ack not received, and 87.5% lease time expires, cliet! ‘80¢8 to rebinding stat in rebinding state , Boes back to - Onteccving DHCPACK, goes back o bound tate andsttime- ‘o resolv Network Address Tran: sod NAT is mainly used (0 overcome shortage of IP address Let's take an example of four computers guters have private IP address such as 10.0 Sex private address are not directly routs The computer 1 then the “ia NAT forwarding table and forwards the same to in * ih So with the help of port number, iti easy 10 ident "ested for a packet internet reply back to the NAT wh the requested client (computer). Now "forwards In network. watnerability due to pubic 1 address. Anyone ean access private 1p address exhaustion. ic IP address to fe this, NAT (Network Address Tran is used to conver private IP address o public IPaddress IP address, outer converts is NAT works. cess internet sends request to the router. ind add a unique port number, stores et. Jn wants to a0 it converts public IP address to private a ak ee Scanned with CamScanner Advantages; © Pro tensive use of public add, 5. «Deals with more incoming tafe ) Dynamic NAT : * Reduces cost. Disadvantages : Router maintains a pool of public add internet, the router connects the internal h 7, whenever an intemal host connect tothe ost with the fi NAT isa technology where arouter or any network device translate ‘one IP address into another IP address. ie NAT (SNAT) Dynamic NAT (DNAT) 192.168.102=56.421 192.168.103=56.422 192.168.10.4=56.429 Secure since it is dynamic. Drawback : ery ex, 10 maintain block of public IP address. ive, since router need to maintain block of pul very expensive, Port Address Translation (PAT) raftic from 5 ; Port numbers are used to map traffic re SAW apne eaten io oul pecific hosts on the network " slated 0 1 192.168.100.2 © 1.2.3.4 race “ iia rent port number assigi ferver 192.168.1004 « Scanned with CamScanner 328 Com Puter Hee When LAN estat LAN swaps with publ 192.168.1003 192.168.1004 session unique. Advantages : Handle number of priv Port numbers enables fair commut dress and generates a unique port number making ext WAN =I{—} WAN (external server) then each host eq, ingle public IP address, Public Internet Wer [es Server [Po 192.168.1004 User enon Laver 533 FORWARDING OF IP packers Forwarding Means rout the packet go, ‘Compare with Subnet Mask network, the router gets IP address sat Scanned with CamScanner which is fiw | ' ‘Network Address Nexthop | Interface 26 | 10110100 .01000110 .01000001.11 2 m2 25 10. 01000110 . 01000001.1 - m0 4 100100! . 00000100 . 00011100 - m3 22 | 11001001 . 00000100 . 000100 - ml Defaalt 180,70.65.200 m2 interface through which Sol Computer te ve, nee to the network thous interface. then it conn Ri can directly ects to the interface of Rp IF RI needs to conne When IP address come forwarding table. subnet mask. Inthe gig from longes 1g previous ding table starting f the forwar diagram, net vibnet mask is 26. construct table BY ree [No] Network Address ‘Next hop Interface 1 | 180.70.65.192/26 - m2 2 | 180.70.65.12825 - m0 3 | 201.422.0724 - m3 4 | 201.4.16.022 z mi 5. | Defa 180.70.65.200 m2 2.3445 are directly connected with the interface m0, m1, m2, m3. For the network 1 ly connected through router, next hop is interface 180.70.65.200. fa packet matches wit ‘packet matches with first row, then packet is transferred through interface m2 Example : Packet artives at RI with dest -an forward, n address 180.70.65.140 Find tH Destination a address: 180.70.65.140 first subnet mask from table is 26 180.70. 65 fo get 140 => 10001100, Apply subnet mark 1000 1100 1100 0000 ‘subnet mask 1000 0000 180.70 .65 . 10000000 180. 70 . 65 . 128/26, this does not match the table first row, so it cannot be mitted through m,- trans = If subnet mask is 25, then 1000 1101 Subnet mask 1000 0000 7000 0000 => 180.70. 65. 128/25. It matches with table entry. So, this packet can be transmitted through m,- Address Aggregation : 140,28,7.0726 Network 1 Ch 740.247 64/26 mo Network 2 mt LJ ——— SO mo 62) 740.247.1287 28 | ing at a Network 3 [_H 3 740287.192/28 Network 4 | a Scanned with CamScanner Computer 1, Routing table Tor RS Se 332 ; Routing table for RI et La Network Rest T tere Rew Ne dress lop 7 26 mo ‘| [140.24.7.0/24 ene 426 mt | {0.0.0.0/0 (other) 140.24.7.6 - 140.24,7.128/26 = m2 - m3 ‘Address | m4 of R2 | Routing table RI and R2 clearly describes the interface to access different netwoy, led as supernetting or aggregation, 26). O29 sas two bits used to determine Hostip, There are 4 networks 4 x 28= 2? x 2" Combining different networks Each network have 2 = 2" number of hosts are possible. Longest mask matching Each packet has a destination address, through which packet can be forwarded. ‘more than one network address matches wi the longest mask matching with the de ‘and /24, then /27 is first entered than /24, ion address. If there are masks like /27, (26 Hieravichal routing Consider : 120.14.64.0/18 - Staring IP address, 16384 ~ Total number of IP address 4096 4096] [4096 address } | address || address 4096 address in each subnet eee ‘eaeeeane 16.26 an [so | os Prez) veo = Ey 3 t rw] | seo 222% (4086) am é 4 (nes (4088) 12014980720 120.14640720 ro! ‘20 1480020 TTITT TT] 3 etn 8 Paz a512 re0147a0%3 B subnetwork each ofSt2addess Connection Oriented Protocol (forwarding based on label) In connection network, it has to search entre table to find matching with dest address which is time consuming. So in connection oriented approach, label is attached tothe packet and searching of table is done through t x identify On matching with label in the routing table, it also refers the next label to identify the next hop. Scanned with CamScanner Label’ | irtetace __|_Nextlabe! Index ™ corr Matches . with for Next label hop . $ . 0008] ‘Switch FP=2 0017] — = pe Forward Packet The entire IP packet is encapsu ; is added, Packets encepslated s payload in MPLS packet and MPLS heat ‘hing (MPLS) both router and switch. MPLS 5 router, forward packet te ‘witch, forward packet based on label, MPLS MPLS Payioag — Pheacery 'P payioag ‘ack of Sub headers used for hierarchial switching, =— Internet Control Message Protocol ICMP) Internet Group Message Protoc Address Re: to send data in effective manner but which may be corruptes delayed or being congested in a network, thus make it unre Jed into two parts : header and payload. Header | Payload TP datagram 5 so os at Version | Hen | Senicobts | Tota length Fags] Fragmentation Idontficaton abis|__ofset Th Protocol | Header checksum ‘Source P adcress onan Fa |—orowrsine is connectioness protocol which does not gurantee the transmission ‘referred as unreliable datagram protocol. It uses datagram approach, is known as unreliable datagram protocol -a best effort delivery service. Internet Scanned with CamScanner destination, Tre shende length defines the tt length of datagram header. Pyg je lenis = i length header. cro, nen S samer bits ar represented 8 Type oF Service (TOS), Defines managing trafic and providing QOS ; Options - used for testing and debuesing- quired for the datagram. ag Options are not actually re fed into two categories ‘+ Single byte options se byte options ‘Single byte options are : + No operation (used as Fillet) 4 End of option (used for padding) le byte options are : ‘+ Record route [used to record routers that handle datagram] + Strict souree route [option used by source to predetermine route based T0S, ‘min delay and max throughput] Loose source route 00 lar to strict source route in addition of datagram et Visit other routers 1 ‘] Tim i ir ' stamp : [Records the time taken by router to process the datagram. Payload is the original data, Total length Pri Hength of header and payload. To find the length of payload header, header must be s i subtracted, area multiplying HLEN field by 4, d. Header length is obtain Length of payload /data = Total length - ( HLEN) * 4- 1 oe umber of routers yi '¢ maximum number of route pe normally ew ted by the datagram. This TE + between the source and ™ Header checksum = Itchecks error in header. Error on payload i left tothe protocol thats responsible for payload. source and Destination Address : small On receiver side these fragments are reassembled to get the original message, This Process is called defragmentation. ‘Since different networks have different MTU, fragmentation required in IPV4. . Payioad | IP datagram Traler |r Header Frame payload => < igre Maximum ranser Usk (au) Scanned with CamScanner rach fragment is converted into packet During fragmenta © Total lengt ranged to size of fragment. im Jnanged to size of frag secu POTTER aspect 10 be provided security sues that a faced by datagramy packet Sniffing indirect number of fragm 10 IPVS datagrams. eFragment offset + Checksum i reeale IP datagram on fragmentation has its impacts on three fields : Ve Flags attacker intercept the communication and copies the 1P packet without disturbing the IP packet without di Fisturbing Passive attack so it does not corr re poate eaten oh ae Fragmentation offset Identification Field: This field helps the destination in reassembl says thatthe datagram is originating from source. Ident uniquely define the datagram. packet packet modification = active attack where attacker modifies the actual tack where fies the actual data and se jet can identify this activity if communication is ‘opine integrity mechanism. the receiver. th proper IPSpoofing : ‘Anattacker can masquerade by entering into the internal IP address and sends packet toother in network by forging them. IP sec provides following services to provide security tothe network. (Private keys Packet Encryption (iv) (Private keys : The two parties who agree 1° establish connection bet ween them can share a secret key. ted and can make jitted can be enerypted and can m: Packet Encryption : The packet to be transm the data unreadable to the attackers. Data Integrity + guarantees the dats being WansmN ‘malfunction by the attackers. x§ does not undergo any sein of pocket. Thus prevents IP {%) Origin Authentication : can ets He orn 1 ket Ths Spoofing attacks. Scanned with CamScanner Com Ute Ny 1S yet 3.6.2 ICMPV4 See] st sone >. 16 bts Type _| Code | Checksum Rest of Header IPV4 has no Error reporting and correcting mechanism. \ Encapsulated Mechanism for host and management queries. a ‘message fo Data / Payload ICMP designed to overcome above two deficiencies. integral part of IP. No TCP or Upp eee aac ef ees since these are associated with trang re ICMP Error Mesase Format layer above. ‘common error Feporting message type and code ate: ICMP is anerorepoting protocol, that sends eror MessaBeS (0 SOUrCE I addy 03 - Destination unreachable (code 0 to 15) Error message includes the information about non delivery of packet, HL Sous quench (onl codsty use of end users, H is used by network administ 05 — Redirection (codes 0 to 3) hat includes ping and traceroute. 11 = Time exceeded (codes 0 and 1) ICMP packets are IP packets with ICMP in the IP data portion. 12— Parameter Problem (codes 0 and 1) ICMP message coi IP header of original payload, thus helps to ide packet filed ducing transmission. Data Section in error message finds the original packet that has error. Messages: Destination Unreachable ‘There are two broad categories of ICMP messages. Is ype = 3, it use different codes between 01 15. Specifies the reason for nom © Error reporting messages very of message to the destination Gi) Query messages Code 0 - Host unreachable. : ris down Ani sage i Example : Access web page sing HTTP protocol bu servers 'n ICMP message includes header of § byte and variable data section, i Owe © Error reporting messages : nrce Quench : ; ne Itstype = 4, "This error message informs sender about the congestion in network, Redirection Message : ‘+ ICMP can report errors but does not correct it, Error messages are sent only to the jer has chosen message to source and informs that the send Us type = 51 sends erro ICMP does not generate er Senerate error message for (rules) peereeptoeeneeeea © this-host address or special address (wl rameter problem : 10eS not know its own address) ‘or some options are missing. type = i error in header * datagram carrying error message, ‘ype = 12, specifies any * fragmented datagram, Qu : fness of host it nema fated in a datagram, isused tocheck liveliness of host i lated in ‘ot the first datagram, encapsul Scanned with CamScanner echo request «echo reply sits, ovis, 100 bbls, i Figure Query Messages ‘Type and code values of Query me: (only code 0) 13 and 14 ~ Timestamp reque: are 08 and 00 ~ Echo request and yy id reply (only code 0). Echo request and Echo reply the existence period of host or router. Time stamp request and time stamp reply is used to find RTT (Round Trip Time) between two devices to check thet following as a debugging tools, Ping Traceroute EB 'sused to find existence of host in a network, Role of ping i; te ‘ping in ICMP is. ‘orresponding to echo-request and echo reply messae" lata being t 32 starting sequene na 'ransmitted from souree to Time Figure oop in tracerut® Scanned with CamScanner aa Tracert: ie same whereay traceroute availabe in Unix OS and tracert in Windows NT baseq os. In ICMP checksum is calelated over entire message including header ang Fs 3.7 IPV6 ADDRESSING IPV6 resolves the small size address space of IPV6. It has 128 bit Address of: address space, JPU6 as coln-exadesinal representation, These are divided int 8 poy each 2 bytes. Example: ABCD '23 : 8967 :ABCF:C201:5432:E024 IPVG has 3 addressing methods icast address © Anycast address dress identifies single network lc host called groups, which holds m is assigned to group of interface. It Broadca ast address represents madres. Any cast addres 'vered to only one interface, possibly nearer one. Features of IPV6 + Large address space, ified header ~ end connectivity + Auto configuration Fast routing / Forwarding © IPSec * NoBroadeast i vover see cnyeast suppor address representation : «Discard leading zeros, Ex: 2004 : 0000: 3131: FEDI-003:c000coon¢F5 u 2004:0000:3131:FEDI:33:0000:o000:erB «Consecutive zeros can be replaced by colon In IPVG changes have been made in IPV6 datagram Base header 2004:0000:3131:FEDI:33:-EEFB size and format in terms of Base header ‘New options Extensions Resource all Security Base | Payload | header A aes eee ey r Trac Flow Label Version | Vass aa Payload Lensth | Header Limit ‘Source Address ‘Destination Adcress Scanned with CamScanner 346 Version —Defines version number of IPV6 “Traffic Class ~ Distinguish different payload with requirements, Flow label ~ Handles data flow. it~ Same as TTL in IPV4 Computer Hoy Payload ~ Actual data IPV6 payload IPVGisa combination of base hy = and extension header, ade Header Tew Heed] Length eesion Net Peader| Leng 7 = Concept of flow control and priority is adopted in IPV6, In IPV6 datagrams a pe na tagrams are fragmented only by source not by the router as six types of extensi i re 'pes of extension header to provide more functionality to the IP Payload (ESP) Hop by hop - sends i ie sends information to router Al Hignmem purpose __ pad N ~ Used extra bytes foratigman Jumbo Payload ~ longer payload, pestination Option ~ edits FOUN source Routing Follows sic souce and ote cue ote Fragmentation ~ Only source can fragme ique to find smallest MTU. Sment a packe Source send nds informat Yormation to ony destination not to the i te Authenticatton ~ It validates the suthen ESP - It provides confide 38 SUBNET subnet, or subnetwork, isa segmented piece of larger network. More specifically, of an IP network into multiple, smaller network segments. n ) is the method for sending data from one computer to another over the internet. Each computer, or host, on the internet has at least one IP address as a identifier. ‘The Internet Protocol ‘ions will use a subnet to subdivide large networks into smaller, more efficient subnetworks. One goal ofa subnet isto split large network into a grouping of ize trafic, This way, traffic doesnt have IP addresses are presented inthe form of four decimal numbers separated by periods, 203.0.113.112. Every IP address has two parts. The first part indicates which network ‘headdress belongs to. The second part spec that network. However, the length of the “first part” changes depending on the newwork’s class. 3.9 ADDRESS RESOLUTION PROTOCOL Address Resolution Protocol (ARP) is a comm TCP/IP Layer 2, protocol that works on the © ARP helps to get the MAC address of the connected router or gateway from the IP address. Which one device sends a request 10 the other device will respond! ARP packets are encapsulated by to bea li Scanned with CamScanner Computer 348 Neteg How Does ARP Work? an 1 packet, the sender aust know the destination ny ‘+ Before sendin address. 1 Type: Itis a 16-bit poadonate . protocol TyP id that defines pr Ifthe MAC aes isnot known then he send broadcasts the ARPAago, ’ . NES Protocol using ARP, ‘the MAC address of the intended dest mn, Hardware Length: Itis an 8-4 defines the length, + in bytes. ngth ofa physical address {, Protocol Length: It is an 8-it Feld that defines th bytes. 1 length of IP address in o nd back aunicast packet with its MAC address 0 the seme, 7 ofthe ARP discovery packet, + Overt PO Reply nt finest porch DARP Regt id (i a ‘© The sender will receive the ARP reply and updaté the ARP check and stan ° sending a unicast message othe destination, 4 Sender Hardware Address: It isa variable length that defines the physical Hosta Host address of the target. " veoneats te2.e023 Target Hardware Address: Itis a variable-length field that defines the logical address of the target. 410 REVERSE ADDRESS RESOLUTION PROTOCOL (RARP) ‘Sento ac | Sear ] Tegaies | Tage is aoc el ae oat col eee Reverse ARP is a networking protocol used by a client machine in a local area 1.1 Joooe00 000 | 2 1682.8 Internet Protocol address (IPv) from the gateway-router’s ARP raivork t0 request tle, The network trator creates a table tte MAC address to corresponding IP address. When a new machine is setup or any which don’t have memory to store IP address. needs an IP address for its own gateway-router, which is used to map ‘SenaerMac | Sensei | Tepetnas Sow | 5 em oosnscovoco| reaver2 | ooeese sono] use the machine sends a RARP broadcast packet which contains its own MAC address Format of an ARP Packet th sender and receiver hardware address field. The following diggram shows the format of an ARP packet, ARP Server Hardware Type el Device = ar > Sj tenor | nga [PP#O" RP Ree r as play 2 = a Sender Hara = te Att (er Ex Soe fo Err i = Sender Protocol Ades (or Ex, 4 byes fori Broadcasts MAC Boxer vis Target Hardware Address (lor 7 Needs to know its IP re for Ex. 6 + Target Protc pete Eterny A special ide the local area network, sd as RARP-server is. (co Adress (or Ex ty al host configured inside the RP server attempt 0 by ‘Now the RAI ae! | “msbleto reply torthese kind of broadest packets Scanned with CamScanner Computer Networks find out the entry in IP to MAC address mapping table. If any entry matches in table, RARP server send the response packet to the requesting device along with IP address, LAN technologies like Ethernet, Ethernet II, Token Ring and Fiber Distributed . Data Interface (FDDI) support the Address Resolution Protocol. RARP is not being used in today’s networks. Because we have much great featured protocols like BOOTP (Bootstrap Protocol) and DHCP( Dynamic Host Configuration Protocol). Scanned with CamScanner

You might also like