Advanced Computer Networking (Nirali Publications)

You might also like

Download as pdf
Download as pdf
You are on page 1of 102
Syllabus ... 1. Network Layer and Proto 141 IP Addressing: Address Space, Notations, Address Translation (NAT), 1-2 Internet Protocol (IP): Datagram Formal, Fragmentation, Options. 1.3 ICMPv4: Messages, Debugging Tools, ICMP Checksum, 1.4 Mobile IP: Addressing, Agents, Three Phases, Inefficiency in Mobile IP. 1.5 _ Virtual Private Network: VPN Technology. Classfull Addressing, Classless Addressing, Network 21 IPVE Addressing: Representation, Address Space, Address Space Allocation, Autoconfiguraton, Renumbering. 22 Transition from IPV4 to IPv6: Dual Stack, Tunneling, Header Translation. ; 23 _ IPV6 Protocol: Packet Format, Extension Header. 8.1 Introduction: Inter-Domain, Intra-Domain Routing. Routing Algorithms: Distance Vector Routing, Bellman-Ford Algorithm, Link State Routing, Path Vector Routing. Unicast Routing Protocols: Internet Structure, Routing Information Protocol (RIP), Open Shortest Path (OSPF), Border Gateway Protocol Version 4 (BGP4). tion: Unicast, Multicast and Broadcast. Domain Multicast Protocols: Multicast Distance Vector (DVMRP), Multicast Link State (MOSPF), | Independent Multicast (PIM). ‘Datagram Protocol: User Datagram, UDP Services, UDP Applications. ic ‘Connection, State ission Control Protocol: TCP Services, TCP Features, Segment, A TCP jn Diagram, Windows in TCP, Flow Control, Error Control, TCP Congestion Control, TCP P Services, SCTP Features, Packet Format, An SCTP Association, Flow Control, Error and TFTP. tecture Web-Based Mail, E-mail Security, SMTP, POP, IMAP and MIME, SNMP. ain Name Space, DNS Operation. ic Allocation, DHCP Operation. and SSH. Poe 21 2 23 23 28 a7 28 28 28 23 SCTP Services 433 433 SCTP Features @ Packet Format hed ‘An SCTP Association an w Control pe Error Control Practice Questions 449 Web (WWW) and HTTP 5 5.1.1 World Wide Web, (www) 5.14. 1 Basic Terminologies in WWW 2 Architecture of WWW 5.2.1 File Transfer Protocol (FTP) 52.1.1 Architecture of FTP 5.24.2 How FTP Works? 5.2.1.3 File Transfer in FTP TRIP 5.2.2.1 Messages in TFTP 522.2 Connection Establishment and Connection Termination in TETP 5.2.23 TFTP Data Transfer Operation 5.3 Electronic Mail tecture 1 First Scenario 5.3.1.2 Second Scenario 5.3.1.3. Third Scenario 5.3.1.4 Fourth Scenario 5.3.2 Web Based Mail 5.3.3 E-Mail Security _ 5.3.4 SMTP 5.3.5 POP 5.3.6 IMAP 5.22 O)stere He and Dynamic Allocation, DHCP Operation P Operation ooo ‘S| Explain significance of the given field in the packet format of Internet Protocol. S| _ Implement IP addressing for the given network. ©) Explain significance of the given field in packet format of ICMPvs. | Explain the given inefficiency in Mobile IP. To understand Network Layer and its Protocols To learn IP Addressing, Classful Addressing, Classless Addressing, Network Address Translation (NAT) ete. To study Internet Protocol (IP) with its Datagram Format {To learn ICMPv4 & To understand Mobile IP and Virtual Private Network (VPN) | inTRODUCTION se Sees */We knew that, the network layer is the third layer of ‘the(Open Systems Interconnection Model {OSI ““" Model) and the layer that provides data routing paths for network communication, + Data is transferred in the form of packets via logical network paths in an ordered format controlled by the network layer. Z * Network addressing, logical connection setup, data forwarding, routing and delivery error reporting are the network layer's primary responsibilities/functions. Network protocol is a formal set of rules, conventions and data structure that governs how ‘Computers and other network devices exchange information over a network. The network layer uses protocols such as Internet Protocol (IP), Internet Protocol version 4 (IPv4), Internet Protocol version 6 (IPv6), Internet Control Message Protocol (ICMP), Internet Group Management Protocol (IGMP), Internet Protocol Security (IPsec), Internetwork Packet Exchange (IPX), Routing Information Protocol (RIP) etc. +/P address is short for Internet Protocol (IP) address. An IP address is an identifier for a computer or “device on a TCP/IP network. * Networks using the TCP/IP protocol route messages based on the IP address of the destination. IP, which specifies the format of packets, also called datagrams and the addressing versions of the Internet Protocol (IP) are in common uses in the Internet today: version 4 (IPv4) address is a 32-bits address that uniquely and universally jection of a host or a router to the Internet. pal ee Network Lay nf Prooclg ‘arance compute Neon oie 2. The growth of the Internet and the depletion of available IPv4 adresses, a new version of 1, Internet Protocal vecsan 6 (Pv) using 18-bit forthe addres, was developed in 1995, + The addresses canbe casifed into flowing two categories static IP Adaress: As the name indicates, the stale TP addresses usualy never change but they say be changed at aresul of network administration. 2. Dynamic Address: These are temporary IP addresses These IP addresses are assigned to a computer when they get connected tothe Internet each tne They are actually borrowed from a ‘ooloftP addrecce, shared over varicus computers < Internet inorder to provide universal communication serves, must flow @ uniform addressing smechaniom which denies machines ina network + The addressing mechanism shouldbe universally accepted and uniquely seni the source and destination host computers existing na network + Fourlevels of addresses are wen an internetempoying the TCP/IP protocols are explained below: A, The physical adress or link addr) isthe address of anode a defined by its LAN ot WAN. Physical addrestes can be ether unas (one single recipi), muleat a group of recipients) or broadcast (tobe received by allartes in the netwer 2. Alopial addres in the Internet i curently a 32bis or A20its address that can uniquely define shot connected to the interne. The logieal adresses an be either unicast, multicast or broadcast. ‘3. meheTCnP architecture, the abel assigned ta process is called a port adress. A port adress in TCPAP is 6 bits in length - 4, Application Speciic Addresses are designed for specific application suchas email adress (Cor example, niraliprakashanepuneecu) and th Universal Resource Locator UR) lke worn mabtecom. - 12/1 edaressng isthe method ured to identity hort and network devices The number of hosts ‘connected tothe internet continues to grow and the IP addzesing scheme has been adapted over time tocope this growth. In thls section, we study P addresing in deta with Pv adress. The v4 addresses are univers ‘hee ht te eigen mus be cpa by any ho a wane connected 2 entre. EERE concept of P Address "An IP adress ean adress wed to uniquely Wentfy a device on an IP network An Padres Is @ ‘bumercal 62 bis) representation hat uniquely ientife a specif Interface on the network. ‘+ Agaritip addres actually consists of following tw parts etwork 1D (or Network Address) Identifies the nework on which a host computer can be 12 twa Layer ng rowel FED saree syne ssa ir ser cola ‘Aprotocol . space i th total numberof addresses used by the protocol Ifa protocal uses bits to an address aainse cw addres, the address space is 2 because each bit can bave two different values (0. or 3) and Whitscan have2" values. ‘o( arva uses 32-bit addresses, which means thatthe address space is 2” or 4,294 967296 (more than 4 ~bilon). © Theoretically, if there were no restrictions, more than 4 bilion devices could be connected to the Internet fe tnclsful addressing he addressing space s divided ino five classes as shown in Fig 2.3. the Fig. 13, we can see that Clas A covers half of the address space, Class B covers 1/4 ofthe whale address space, Class C covers 1/@ address space and Classes Dand E cover 1/36 ofthe adress space. ee ee ‘ig. 1.2: Occupation ofthe Address Space in Casal Addressing ‘© Folowing table shows the number of addresses in each class: 2h=2147,485,648 2 A 2 2 Pn LO7a 741524 2 ic 7 =536570,912 4 D P= 258.455 456 3 = 7°=258, 435.456 riecempuerteimnt ae adress more compact a4 e2ser to tes Bete decal notation the format that typically wsed for slaying the IP aderenig a human readable format. An example of dtted-decimal notation #392168:1300 pie: Example i: Change the flowing Pa adresses fom binary notation to dotted decival notation — {10000001 d000:01s ooodzo%1 120128, (iy 22000003 ro0000%2 oootz02 1183 {iy 10012: morx012to00ron osx0s1 (i) sum1002 190m ssst0n 00001 soltion ‘Wereplac each group of bits with it equralen decimal mumber and ad dots for separation, @ wiz saszuzzass (uyzsiasasea o_o ‘Beample2: Change the fllowing lve addresres from dotied-decimal notation tbinary naan, (i) m2564578 @ zausze2 ap2eiasex2 (75453478 solution ‘We replace each decimal number witht binary equivalent. (9 ex10112 90111000 ootort0xo100:110 (i) sso:s103 opsoootocoooott cxox0010 {22210001 90001000 00111000 09001100 + 6x) 01001011 ooxos203 ootooosa 1001110 7 Bxample 3: Change the ellowing rvs nreses fom binary notation Wo hexadedimal notation {10000001 oooox02 oogeuon sista (691000001 10000083 oooatossaatsa solution: We replace each group ofits with ts heradecimal equivalent, feaiecaa sormalvbas nosed pce rr weer OF er OO ean ee ee {Gat the end to show thatthe numbers in hexadecimal, (i) OXB10B0BEF or S10BOBEPIE. 6) oxcaamerr or cussiBFr6 ‘Baample 4 Find the ero, fanyin the flowing Ie adasea, () 212.56.045,76 (i) 2213478.20 (is) 75.45.2014 (i) 2100010231457 Solution: (There mustbenoeading sro (045). (i) There can bene more than four nursbersin an ft ad aaa aii etal 3, Dotted-decimal Notation (B Internet addzesrer are usually written in deci 1s thnk Layer and Preteoie ndvacns Compute Nebotk ‘Guy Each number needs tobe less than or equal to 255 (301i outside this range). fecimal notation isnot allowed Classful Addressing = -Asaddres Is ofthe form (Wet ID, Host), where NetID identifies the network and Host identifies {heer one never This adreing schemes ao refred oa thle addressing scheme fest senting ‘+ mPaddreses, when started a few decades ago, used the concept of clases. This architecture called lest addressing ‘+ “Three typeof cnsauladdresnes are Clas A, Class B and Class CIP adresses previously had one of the first three forms shown in Fig. 25 as pr the original addressing scheme. + Clarsfl addressing, te adress space fe divided int five classes A,B,C. D.and 1 addreses, when ‘tartd feu decades ago, used the concept of classes. This architecture is called Clasful addressing. + tmlass A the network lengdh is 8 its, bu since the frst bit, which sO, defines the cass, we can Inve ony seven bits as the network identifier. Tis means there are only = 128 networks In the vworldthat can haves class address. + Incas, the network length is 16 bits, bu since the fast two its, which are 10), define the class, vracan hav ony Abie a the neork Mester. This means there re nly 2= 16584 networis world that can have a clase B address. ‘+ Alladdcesses that star with (110), belong to class C. In clase, the network length is 28 bits, but since three bits define the clas, we ean have only 21 bits asthe network identifier. This means there are 2"=2,097,152 networks in the world that can have aclass C adress, * Clase D is not divided into NetworkiD and HostID. tis used for multicast addresses, All addresses shat stare with 111. in Class D, Clas Eis not divided into NerworkiD ‘and Host and i sed as reserve + im classful addressing, an IP address in classes 8,3, and C is divided into NetworkiD and Fost. ‘These parts ace of varying lengths, depending on the cass of the address, Fig. 15 shows the NetID and Host bytes. Uiterrritrreieetiriiire iii Ipsos atest % Cred aa 8 eaaresses « se Sete tae ah as ) Henin | 2228s a5 } o Mulbeast Adsress. 224.0001 e 2400.00 10 aay * In classful addressing, the address space is divided imto five classes A, B, C, D, and £ as shown in 15, Each ess ‘occupies some part of the whole address space. Fig. 16 Advanced Cage Nemec u Noto Leon rotate inne A: 2" =2147 483,648 addresses, 50% 073,783,828 addresses, 5% ‘tase C12" =536,870,912 addresses, 125% chases 2 = 268,435,456 adresses, 6.25% clase #2" «269,495 456 addresses, 6.25% Range Masie 4. Clase A Address 2 32644008000 OOD MERETEIS 255000 36 i586 ESE Waoootewanssz5I55 _ 755255.00 2% 2000000 8 G6 waoowasasszszs 255552550 268,400,000 22400010 238255255255 1E__ClassFaddresses are reserved fo tur use (and Class Dare usually used for testingeni). ‘The first bit of the first octet is always set to zero, The highest order bit of the network byte is slay. Sothat the frst octet ranges from 1-127, ‘20000003 ~ onu138 ales CaS ey Sep eee ‘The IP range 127xx is ‘seve or lop bac address. The default subnet mask for class AIP adcess is 2550.00, This mean it can have 126 networks (2) and 16777214 hosts (27), (hss addres format eth: ON NNR HEHE HRA A First byte specifies the network portion (@ bits) | tly ape emsining byes specify the host postion (24), Networkvales of and 27 areresered.thiaclasis PPG a Copan pe ‘There are 126 class A networks, There are more than — — = 16 milion host values fr each lass Ametwork. ig 17 Clans A Adresing (Clase B Addressing: ‘ere the frst two bits in the frst two bite i set to zero. The highest order bits 6 and 7 ofthe network portion are20. 10000000 ~ souza12 328 - 191 Sie 8 Addresces range from 128.0xx to 191255.2x The default subnet mask for Class B Je ‘lass Bas 16368 (2) Network addresses and 65534 (24) Host addresses. wor ayer end Protests avaead Compute Nove address format is: 1ONNNNN'.NNNNNNNN AHHEHHHH.EH EERE, Photos aby i or si ‘ig. 18: claseD Addressing © chase + the first two bytes specify the network portion (46 bits). The last two bytes specify the host portion abit). + This class is used for medium sized addressing networks, There are more than 16 thousand class B siebrorks, There are 65 thousand nedes in each cass B network. 3 Class Addressing: + The firot octet of this class has its first 2 bits set to 210. The highest order bits §, 6 and 7 of the networkportion are110, ‘11000000 ~ 4022331 «cum cm anaes Ao em 6200 56th ft tak fr Ch sone ‘© Class gives 2097352 (2%) Network addresses and 254 (2) Hort addresses. ‘© Class CTP adress format i: 110NNNNN.NNNNNNNN NNNNNONN. HEHEHE. ‘© The first three bytes specify the network 3bas to Portion (24 bits). The last byte specifies the ‘hast portion (8 bts) This class is used for =] 7 Host orton Mig-19: Clans Addressing Addressing small sized networks. ‘* There are more than 2 million cass € networks. There are 254 nodes im each class cnecwork 4 Class D addressing: ‘© The first fourbits ofthe firt octet in class D address are set to1330, ‘m100000 ~ 1mio11 24 ~ 239 ‘© Class Dhas iP addrese rage from 224,0.0.0 9 239 255,255,255, Class Dis resecved for Multicasting. ‘+ tn multicasting data isnot intended for a particular host, but multiple ‘ones. That i why there is no need to extract host address from the class Div addresses, ‘+ The Class D does not have any subnet mask. Class D address defines @ Fig. 1.20; Class D Addressing sgroup-1D and used for multicasting. ‘+ Internet authorities have designated some multicast addresses to specific groups, 5 Class Addressing, the lass = wpadresses are reserved fr experimental purpose RSD orstudy. - oh i “Reserved for ‘Se i + BPaddtresses in the class E ranges from 240.0.0.0 to 255.255.255.254. * This class too is not equipped with any subnet mask, Fi shows Ads Clase 8 Addressing ‘address format of class E addressing, = oy a Baamples: Trample i Find the dass ofeach address (@ 00000061 ooooi021 00001011 11101144 oe (4 12000001 19000013 coors011 12102511, (Gh 10100132 11011021 1000012 ox101112, (iv) ano011 1001012 12101 0000114 Solution: (The rst bit is 0. Tiss class A address (i) The first 2bits are the third bits O.This is a lass Caddress, (i) The first itis; the second bit sO. This isa class Baddress. (i) The frst bits are 4s. This sa class Eaddress ‘Brample 2 Find the lass ofeach address: ( 22742248719 ( 193245622 diy14232208 Go 2sasasasa Solution: (i) The tet byte is 227 (between 224 and 739); the assis. (i) The first byte is 193 (between 182and 223); the classi (ii) the first bytes 24 between O and 127 the clas is A. iy) The first byte is 252 (between 240 and 255) the class E FEBS cassece addressing rye pee Rao tab trae ince evn a Se a ee eee ee en mime Ce oe, Ser in ara eee eee eens ee aac Eee peters apie Nip pa parte pene Egcunene oe as eee Spee een rermen teeresinaa Br geetieseree are eeee a a ee ey Sees eee pec ce re a eee 7 SEE Poa e shemmte geeretta Beene toc one euunsconar coo ne eee (eas eae co eee + Some routing protocols, such asthe Bogder Gateway Psaigco (BGPv4) and OSPF, support classless addressing eae Releeenas eee ory ig. 12: Variable length Blocks in Classless addressing * (iaclassless addressing, when an entity, small or large, needs tobe connected to Interne, it ls granted ‘block or range of addzesses, * Theses ofthe Bock (the number of addresses) varies based on the nature and size of the entry. For ‘Sample, a household may be given only two aédresses; a large organization may be given thousands » tetrapods oranend Comp tna —— of addresses. An 1SP, may be given thousands or hundreds of thousands based on the number of ‘customer it may serve, +m classless addressing variable-length blocks are assigned that belong to no class. In this architecture, the entire address space (232 addresses) i divided blocks of different sizes + AILIP address have a network and host portion. Classless addressing uses a variable number of bits forthe host portions ofthe addres. Decimal 192 Binary s1000000 360 20 48 40100000 00010100 00110000 2sbits network ————>4bitshost ‘+ Ctassess addressing treats the IP address as a 32 bitstream of ones and zeros, where the boundary between networkad host portion can fall anywhere between bit Oand bit 31. ‘+ The network portion ofan Ip address is determined by how many {sare in the subnet mask. Again, this can bea variable number of bits, and although it can fall on an octet boundary, it does not necessarily need to CConcopt of Network Address: * _-Anetwork address, is particularly important because itis used in routing a packet to it destination Cnetworc ‘The routers in the Internet normally use an algorithm to extract the network address from the estinaton address of a packet. Todo thie, we need 2 network mask. ‘+ Anetwork mask (ora default masi) in elassful addressing a 22-it number with m leftmost bits all, set sand G21) rightmost bits all set to Os. ‘+ The three default masks in classful addressing are shown in Fig. 123 (a). To extract the network ‘address from the destination address ofa packet, 2 router uses the AND operation. ‘+ When the destination address (or any address in the block) is ANDed with the default mask, the result i the network address as shown in Fig. 113 .). bs 266 Mook or class Address TFTA] OoOoOSON COUNOOD NUNBETE] zs000 18s tee Fij]sossouoa penne] 2ss25500 2352552550 es pan npr a Pr ERR] subnetting ®saboeting is» metod for partionng/Adg a dasa # neo no sae ubnetwerky [subnets sut ab + Theproce of eiering ns aeons pal Part ete mask: The subnet mask simply determines TRAen orton ofthe Padres olng tothe haste abet adres is created Dy vg the ‘host address into network address and host address. penny bnting provider the network adminkstratr ih several bene, tnchading extra exit, nov effcent use of network adress andthe capability to contain broadcast trafic. «(Caoallow a singe network address to span mlkp physical networks called subnet adresing or “subnet routing or subnetting. >> 4 Subting enables the network administrator to further divide the host part of the address into two seers bets in ths case, prt ofthe host address reserved to enti the particular subnet 4+ Subnerting allows you to create maple logical networks that exist within a single Class A 3, orc Retour fy de not subnet, You wil nly be able fo ue one network from your Class A,B, oF C network whichis unrealistic 4 Each data lnk on @ network most havea unigue network, with every node on that ink being a member of the same network If you break a major network (Class A,B, or C) into smaller ‘uetworks itallows you to creates network of interconnecting subnetwork, «+ ack data link on tis network would then have a unigue network/suletwotk ID. Any device, or fatewey, connecting n networks/subnetworks has n distinct IP addresses, one for each etworKubnetork thats interconnect 4+ Tosubneta network extend the natural mask using some ofthe bit from the host 1D portion ofthe Address to create a subnetwork 1D, For example, gen a Clas C network of 204355.0 which has a tural mak of 255255255. youcan create subnets inthe following manner: 2041550 +s1001100.9000111 9900010100000000 assassassaae — auud sista m00000 eu) + Byestending the masito be 255255255224 you have taken thre bits (een above aa "sub") fom the erignal host portion of the adaress and used them to make subnets. With these three bis, it 8 posbleto creat eight subnets. ‘Wits the remaining five host 1D bits each subnet ean have upto 2 host addresses, 20 of which can actually be assigned toa device since host sof ers oral ones are not allowed (ts very important torememberthis) +o, with this in mind the folowing subnets have been created. 2042550 255255255224 hostaddress range to30 20425532 255255255224 hostaddressrange33to62 2OAI5S.64 25525555224 _hestaddress range 65t094 20415595 255255255224 host address range96 10126 204355328 255255255224 hort addrest range 129 0158 20455360 255255255224 host address range 161 to 190 2oHasSAs2 255255255224 hort address range 193 to 222 204355224 255255285224 _hostaddress ge eh Network Layer and Protects aes ‘+ Using the network subnetting scheme appearas shown in Fig 1.14, spurred above, which allows for elght subnets, the network might pows7s3e2r aousrssea ou 1780007 3 suirsoar oi 7.5902 soir S8a rigs Fig 115 shows a network using lass B addresses before subnetting, In this example we have just one network with almost 216 hott. The whole network is connected, through one single connection, to one ofthe routersin the Internet “aia Taaeeay iazesase 14154255250 ‘othe reetfine niamat rig.235 + Fig.146 shows the same network in Fig. 1.5 after submetting. The whole network i still connected to ‘the internet through the same router, However, the network has used private router to divide the networkinto four subnetworks. vaia.z7 28d wisason2s saisaesass| | raisssas t41sag027 subnet? sausascone vauateat veisazzne7 14%.14268.264 vanazet 14144427 1% ee] Re) 21 4:12 018 = E Subnet x ; : Ste rower Network: 141140.016, Aavanced Computer New vanced Compu Water — asa cs GT Fa od Wet He Cel os eee ee tin vt paiept WAN i. Tha SST crac a gave rusansza zs. the mame Mat tes forthe Comal oes end vies the rtf a ort Spe numberof addres aceasgnl tO: Connloteensea Eton Wess ne prefer each neort ceinmgieaagez? norma 6/i8 sano th contguron dig he tangent The ena fl wes sre Tecoma hr et nef ten oh ery 7a IN aera si atest ea TEED fT2:2027 2 on pss nes 7012100367292 7052300572 nani a otro the cmpany bs rset as aren the cae a etn adres forte pntopn comecinsin WANS Examples; ‘Beample 4 Assume a compe West office Ne =16 gan + log,(64/16)=28 Fig Sara Suet yosaorreat rose ain rasesco.778 roszwogsir Tagg wowse? 703210057308 ‘screens tom 7012 10.12810 70.12.4008 . Te aaivenaio hirer 5 Eamets i mee Tramps is sprite ated Wok BORK OV26 Te engutaton nets on 72 nan eu number af ea: Din the ete and id he information Setar Te umber of adresses for he whole network canbe found as N= 2°= 64 The it aes in sheen 0s an art ss 0432327 Wee sgn te bere: 1 Wogan are fr echestowtor omen he ister power of) 2. Renbnstotah foreach neni fertvemyenee ep = eg 28 2 we gat 6 ain ech abt arg fm th fin rable rg 128 show the ‘wbblock for each subnet. Note that the starting address in each subnetwork is divisible by the ‘mumber of address in the subnetwork. = - 190:3412.12728 soa i20408 ast adress Fret oaerss Noeune wyoserzeucn §—tanzutzonzn © (190.94.12112708 190.34. 12778 “Frases, es oes Fit serene Pietasieas | Loctadrose ()sbobioes mips NE FEE) Masking packed dtermine whet an dsecalng A proces that exacts the ces aa ret sant tacrea alot nating we one the nmetng hen stn Caroce tn iene cem onan ree ‘inners ob tat ere caer reese nhs way. Afterall here arent {Ep feeteneweri ache ln hss uso ahs teen eens hae Clas walle uowere ts pblet pub Palos ren artery cresting onthe ‘etn sngy aston of newek oe that canbe neo epee one LAN ono Intrarteort netye fone fon Tha ngs SP might ve ae Aedes ieee and might frm ot pas of te address to its clients in the form of subnets. = oor Im many cas a large 167s clients are smaller ISPs, which in turn supply addresses to their own clients. Asubnetallows the flow of network traffic between hosts to be segregated based on a network configuration. ‘A subnet mask (or number) is used to determine the number of bits used for the subnet and host, Porto of th den Te mak a 2280 we that wes ones forthe etmek nd portions and zero-bits for the host portion. i a Subnet Masks ‘+ IP networks can be divided into smaller networks called subnetworks (or subnets). The subnets created through the use of subnet masks. : ts on The subset mask Identifies which hits in the IP address a ‘networkisubnet portion of an IP address. See SL pereeena es ‘The network maskis used when a network is, ‘not subnetted, When we divide a network to several subnetworks, Fig. 1.19 shows a subnetwor eee rk has subnetid network mask (or subnet mask foreach Subpetwork mask so nbs... _S2-nits etn eo we need to create a —_ 2 _ines, ii "ig 1.19; Network Masicand subnetwork Mask trae ent Pg, Aernend Compute Reto ofthe IP address as shown in Fig. 1.2, + subnets are create by borrowing bits from the host portion +The network portion ofthe IP address and fleas ean the new subvne bis are used to define the, new subnet, Routers use this information ee ase = proper a + Subnetting is the process of breaking ¥ down a main class A,B, or C network into Network subnets for routing purposes. —_— nite A | Ce == netmask with the only real difference being that you are breaking = larger ‘organizational networ into smaller paris, fand each smaller section will use a eee different set of address numbers, Ltt thaasted elon hea tea) + This will allow network packets to be routed between subnetworks. When doing subnetting, the rhumber ofits in the subnet mask determine the numberof available subnets 1+ Twoto the power ofthe numberof bits minus two ie the number of available subnets, When seting up subnets the following must be determi © Number of segments, and © Hoste persegment. _/” Sobnetting provides the following advantages: __g--Network Traffic lsolation: There sess network trafficon each subnet, 2° simplified Administration: Networks may be managed independently. © Improved Security: Subnets can isolate internal networks so they are not visible from external networks, ‘+ 16 bit subnet mask on a class B network only allows 2 node addresses for WAN links, A routing “lgorithm lke OSPF (Open Shortest Path First) must be used for this appreach, ‘+ These protocols allow the Variable Length Subnet Masks (VISM). RIP (Routing Information Protocl) sand IGRP (Interior Gateway Routing Protocl) don't support this. ubmet mask information must be ‘transmitted onthe update packets for dynamic routing protocols for this towork. + The router subnet mask (s different than the WAN interface subnet mask. One network ID Is required by each of © Subnet, © WAN connection ‘+ Onehost Dis required by each of; © EachNICon each host. © Eachrouter interface. + Typesof subnet masks: © Default Fits inte a Class A.B, or C network category. © Custom: Used to bresica default network such a8 a Class A,B, or C network Into subnets ‘Borrawed bts Network Lay ond rotocts ask 0 [Masking Makintiry {4111511 00000000 00000000 00000000 24111111 13211111 00000000 00000000 jauuaniia a21tttts 14111321 00000000 255.255.0.0 255255.255.0 ‘Sioa mask 2552551020 4134600 ss4a7s23 Fig. 124: Host Communication ‘A-subnet is defined by applying a bitmask, the subnetmask tothe IP address. If bt s on the mas, the equivalent bitin the address is interprated asa network bit. {f the bit in the mask is off, the bit belongs to the host part of the address. The subnet is only known, locally. To the rest of the internet, the address is still interpreted as a standard IP address, Local Network 13407322 Fig. 1.25: Host Communication with Subnetting, ‘amples Find the subnetwork address for the following. 1411811416 aah 20033422.56 255.255.255.240 5 - — Armend Compe ee Solution L saum1ass 255.255.7240 mask a1121.0.0— Subnetwork address a 2003422158 wrAddress 755.255.255.240, Maske Zo030 72104 Subnetwork Adress 5 125351257 We Addvess 755.7550, ashe Subnetwork address Superntting, alco called Classes inter-Domain Routing (CIDR 6 a way to aggregate rultile Internet addresees of the samme cast aneral moma thatthe (Padaresees and subnets are within the same network: The problem with ‘last addressing i that theresa ot of unused 1? address space. For wample, a class A network has more than 16 milion possble host addresses. A Class B re orbs move than 65,000 hast addreses, but the facts that only a limited number of Class A lant address space has bern allocated for Internet use. semen the stn ofa cass block with a maximum number of 256 addresses may not satisfy the trecds ofan organization. Even x eid-lze organization may need more addresses, Gun solution ssupernetting In supernetting, an organization can combine several clas C blocks to rete a lager range of addresses. In other words, several networks are combined to create & ‘orexarapie, an cryanization that needs 1000 addresses can be granted four class C blocks, The onpantastion can then use these address in one supernatwork as shown in Fg. 2.26, When you , rey two ot mare claseful networks together, they ae called supernets, > ‘The techeique sipernetting was proposed in 1992 to eliminate the class boundaries and to make : | a acre eshte onto need seins cn be made Ft et hte rg 129 sow, the Segal mem the rae ace anew wes rate | 20884 3 tee atten 10) he one's pale aa addresses. TP address (eg. 6820215170), Other ig sus teampleot ar table «Tir at cease | rasea20 Lape tnordnatsestcangetes = E ‘+ The router then creates an entry in its NAT table. To do this, it needs to know the destination address network to the global adress tses one private address and i cone global address. ' + the private network is [72%0220 sete data packet When an outside data packet comes from the public network to the private ‘withthe NAT table to mow to which private device it's meant to go. OA ; Invisible to the rest of the irakalinaes ; Internet; the rest Fig.129 <4 ofthe internet sees only the NAT router with the address 200.245.8, concept of Address Translation: se pos in wich one or more oa Padres strate nto one ot more loa Areal ice verse otter provide internet cress tothe lea hots) «atten the neddrse of omputersinalea network on ingle P adres, This addres ‘fase te router tht connects the computer othe ere |. Arte cugoing packet go through the WAT router, which replaces he source ares in he packet with the global NAT address. vig.132 « Ttncsang prhate lo pss trough the MAT router, wiih places the destination addressinte ach rw inthe NAT table ao pacing of private I adress with ouside destination aeons OO packet the NAT router plobal adress with the appropriate private address. port This palrng is called a connection. Each device on the private network can have multiple active + Fig.130 shows an example of addres translation ‘connections. nn te NAT ey i sted the router pases the at packet the sb netor, ts Stcded ton aes ata ace comer in rome pbc eter Source” Coreen can erreur tipster tat to avd antiga, modern MAT cies incorporate por number in ado to 12 dire, Tas mah esl to rack apto-app connections beens piste Svcs o public Seve, Such techniques ae ced Networc Addvs and Prt Tranaation (APT), Prt Ares ‘reson Pat) amongathes ‘Using One IP Address: , + ala simple fom, a rant tbe has ony two columns namely the pit ss ‘eral ares Gntnaion dest te packet), ea wast Sour 172.1834 Sour: 2002458 srateaa Destrason:172188.1 | Destnaton: 2002458 \ \ ‘Sat they an travel across networks and arrive at the correct destination th) tear nena te 12 ewe Lye Sn Protea : are addres of the outgoing packet, It also makes ote ofthe When the router translates the source ada eg mal ee te Aeatntonaenrhere he pach! ging When the esp therowtes ars te ures nef te pace (othe eral drs) fn the privat adr of the packet +) Fig. 133 showstheldea, Fig.133 ‘Using « Pool of 1 Addresses: ‘+ Theusoof only one global address by the NAT router allows only one private-network host to access & siven external host. To remove this restriction, the NAT router can use a pool of global addresses, + For example, instead of using only one global address (200.245.0), the NAT router can use four addresses (200.2458, 2002458, 200.2410, and 200.245.) inthis ease, four private-network hosts can communicate with the same external host atthe same time because each pair of addresses defines a separate connection. ‘Advantages of NAT: x 1.NAT solves 1P overlapping issue. === 2 NAT hides internal IF structure from extemal world, 3. NATollows to connect with any network without changing I address, 4” NATllows to connect multiple computers with internet through the single the public Tp address. Disadvantages of NAT: 1) NATadéc additional delay in network. 2, Several epplications 2rerot compatible with NAT. '3._Endto end traceability will network with NAT. 4 NAThides actual ene device: INTERNET PROTOCOL. ‘The imernet Prot a protect they ean eat) is 8 protoca or set of rules, for routing and addressing packets of data 50 Ey a two ay and Protects * la traveing tener vied int ieee aes cers tisntematonbls ote a eat tenet emigre an ey, nd 2 packets a0 «ery er rdomanthat eo cre a aepcirsaren raced tem dtaaaer ered Canetti at thar detnatin, they ave ane diferent depentng on which oe cee th. he et conmon tranpepreca re 1? and Te eet nl rayne fr adesing et into nepali to sia lence aston ad ease and ong gram fom a soc a sae aria ere aces ono more eters Forse purrs he Imre: tcl fins te ema f pies oie on drs om «ern Prt common nd enrlalpot euer ogo of ccefaly es + mover oma tela It mst pied wih ble pees cha CP he ampere Ge +H tahoe hepsi fir in re ree smaller pieces, called packets, IP information is attached seen Slee con (Teme [rr JF Joe |] [owe c a cll sr = ep Dovel et, iS oe a eae rt it Sars aa — as tre Fig:134 Postion of in TeP/tP Protocol Suite HEB vetagram rormat ‘Packer nero Gere Iyer ae cad atgrams The P datagram formats shot fn reise + Adatagram sa vcable length picket consisting of wo pars namely, header and data The header 1201260 bye iniengh and contain infomation cereal ocoutgeetacton 205535 yes —___., te 20480 bf = ig. 1.35:1P Datagram Header Format: * A 20%yte header contains almost 13. multipurpote fields, which hold specif related object ‘information suchas; ‘and source/destination addresses. «header frm contains following felds: 4, Version: This contains the Internet header format and uses only four packet header bits. This {bitfield defines the version ofthe P protocol. Currently the version I 4, However, version 6 (or {Py6) may totaly cepace version 4 the future. This feld tls the IP software running in the rocetsng machin that the datagram asthe format of version 4. 2, Header Length (HLEN} Ths 4-it el defines the total length ofthe datagram header In 4-byte ‘words, This fed is needed because the length ofthe hese is varisble, (etween 20 and 60, ‘bytes When there are no options, the header length is 20 bytes and the value ofthis eld 5 (G=4220, When the epticn fed iatits maximum sie, the vale ofthis field is 5 5» 4 = 60), 3. Type of service (105): This provides network service parameters. The70Sfleld is composed ofa ‘bit precedence il (hich ignored today), 4 TOS bts and an unused bit that must be 0. The Tosbiteare: © 1000: minimize delay. 5 0100: Maximize throghpu. © 0010: Maite reliabitiy, © 000: winimise mentary cet. © 0000: Normal service 4, Total vength: This contains combined data and header length. Tis is a 16-bit eld that defines the iota length Geader plus data) ofthe P datagram in bytes The header length can be found by ‘multiplying the valve in the HLEN field by four. Length of Data = Total ength~Header Length 5 Mentifcation: This 26-bit field contains a specific number for primary data identification. ‘Uniquely identifies the datagram. Usually incremented by 1 each time a datagram is sent all fragments ofa datagram contain the same identification value This allows the destination host. {odetermine which fragment belong to which datagram, “ Mag This router fragment activity is controled by following three fags o Reserved, must be 2er0, ‘Omeansallow fragmentation, ‘imeans do not allow fragmentation. — ‘Omeans that this isthe last fragment of the datagram, means that additional fragments wil follow, |__| wrortgnens) ) [| srieetenies | eae eee aa eee ares piel elon smtpd ae ee eee oS Q < Internet Control Message Protocol (ICMP). 2 Interne! Group Management Protocol (GM) 3 (Gateway to-Gateray Protocol (GP. 4 1 dPencapslatien). 5 swam. 6 Transmission Control Protoel ROW a EvterorGtavay Protos (207) 3 Private Interior Routing Protocol. “| Fa ‘User Datagram Protocol (UDP, | Ey IP Version 6(iP6) so Encap Security Payload for ive (SPL ‘Athentlaton Header or (AN) oy ‘pen Shortest ath First. 10. Header Checksum: I checks and monitors communication errors. The header checksum is calculated over the IP header only. t does not cover any data that follows the header. ICMP, IOMP. UDP, and TCP all have a checksum in thelr own headers to cover their header and data. Te Guat the IF checksum for an outgoing datagram, the value ofthe checksum fed is first oot mien the 16-bit one's complement sum of the header is calculated (Le, the entire header um. sence ay and Proto, 11. Source Adres it soe source parse T3250 ine the adres ofthe sug ‘This ela must remain anchanged during etme the IP datagram travel Tom the source hae Deesaeatia ae 42 betnrlon adder: stores destination I adres. Tht 22 ld fins the Pedra p {he drones ld mat emai unchanged daring tee the xara reas et repemasentidy eaten) 12. options Tish an pacha ade ld and wed for aol information. Wen ty ved thee engi petra 32 FEE) Fragmentation Pg easy tance ps ae nc caer gs re ‘asim ss of date hacen behelda fame eis Maximum Transmission Unit 470) tu neon pre te pga sce mpage EONS tt ae Beeracce Imeverco mane ae? pou inden of ne pla ngpre: th ign cd toe Ne etcteer epi acs assem eae acer tient twee protacl tan MTUt bis te etc cap ate at am mgt eS oe ee feces marcel ogee Fe ay a cae Sane in eae a emer oer te vps loa aaa nea aerated vase ak oes Rieter are yer he erator ands way donee routes) rs ds Sate et aa ae Gro opm nto ine inte fing segmentation strane jer androgen tt eter eer the espe Aner ner at tag natn and rum dtl tds pguetnan i och 2 ay ing am can ely tina ane wae tater of Papmimnnce mien wrormee om 1 atest Te] Nt omoes B=] ‘seer Data ink ayer [FP ; + “ ve Ce aa a Fig. 137: Fragmentation *Hscsver identifies the frame with the identification (1 bit) field in IP header. Each fragment of 2 ‘frame has same identification number. * ‘Recever identifies sequence of frames using the fragment offeet(13 bits) field in IP header. AN overbead at neti ayers present due to extra header introduced du to fragmentation, "el tP ender for Fragmentation: Tomication (5 bite: Use to identify fragments of same frame. To guarantee uniqueness, the i ws sunt pod Pte semrent ome et amory, uniqueness guaranteed, When a datagram is fragmented, the value in the Ideniiaton Beds copld into al fagment. Al fragments have the same Identification umber whichis alo the same a the orginal datagram. The identfication number helps the etnution in reassembling the datagram. 1 knows tht al fragments having the same identification value shouldbe asrembled into one datagram + Flags This treble given blow Reserv: The fit biti reserved (ot used) 9 Domot Fragment (DF » 1 it) Tie cond biti called the do not fragment it. if we dont want the packet oe frgmented then DP it DF = itv 0, the datagram cam De tragmented i necessary. More Fragment (MF = 1b}: Te third bt called temo fragment bit. if» 1, more fragments ae ahead of this fragment and if MPO tithe lat fragment ony fragment a Nore agents Mig.138 + Fragment offset (13 bit): use to identify sequence of fragments in the frame. tt generally Indicates numberof dta bytes preceeding or ahead ofthe fragment. Maximum fragment offset osolble » (65335 ~20)~1 = 65514 where, 65535 is maximum site of datagram and 20 is minimum size of 1P header, So, we need cell (logs65S1¢) = 16 bits for fragment offset but fragment offet {eld has only 13 bits, So, to represent efficiently we need to scale down fragment offset field by 2 i= 8 which acts as sealing factor. Hence, all fragments except the last fragment should ‘have data in multiples of 8s that fragment offeet eN. Reassembly of Fragments: ‘+ Wetakes place only at destination and not at routers since packets take independent path (datagram Packet switching), so all may not meet at 2 router and hence a need of fragmentation may arse ‘again. The fragments may arrive out of order also. — + pact — inmost packet J Last packet fe ivaia olz|g}e Agere: Destnaton sent atagamis agente fom MF, agent oft ad Pestaton held identity al fragment loging to same datagram foment fenton Se ent thet ragment fet =) entity subsequent fragmentusngheder length, fragment ottiet. Fepeatuntla «0. aanples ‘rample 1X packet has arved with an HU value Ts he ora mide fragment? Dowe mow ifthe packet was fragmented? nt ements agent, Solution: the Mbitis it means that there are no more f However i ragments; the fragment is the last one. 4 apetsny ithe orignal packet was fragmented or not Anonfragmented eee eon en fragment. a Ea, ater Lye a Prete ‘Example 2: packet has arrived with an Mbit value ofthis the frst fa cra midale fragment” Dowe know if the packet was fragmented? Solution the 1 bt is means that theres atleast one more fragment, This fragment can be the first one ors middle one, but nt the lst one We don't know i ts the first one or amide one; we need more Snformation(thevalue ofthe fragmentation fee) ~ Example 3A packet has arrived with an Mbit value of anda fragmentation offset value of era ip this the first agment, the las fragment, ora middle fragment? Solution: ‘Because the Mbit sti eter the first frogment ora middle one. Because the offset values Otis takathpaatines nk 1 Eg ~~ Peample 4: A packet has arrived in which the offset value is 200, What is the murmber of the first byte Dove now the umber ofthe lst byte? Solutions To find the number ofthe first byte we multiply the ofeet value by 8. This means that the ist byte ‘numbers 800. We cannot determine the numberof the last byte unless we know the length of the data a npIP SA peckethes ervedia hich the fot valve 6100, the valve of HLEN i Sand the value of the total length els 100, Whats the number ofthe ist byte and the lat byte? Solution: ‘The first byte number is 100 x 8 = £00, The total length is 100 bytes and the header length is 20 bytes (5 4), which means that there are 60 bytes in this datagram, If the first byte number i 800, the lat byte number must be 79. ‘xample 6 In anIPv4 datagram, the Mbit is, the value of HLEN is 10, the value of total lengths 400 and the fragment offset value is 300. The positon of the datagram, the sequence numbers ofthe fist andthe ast bytes ofthe payload, respectively are: (@ tas fragment, 2400 and 2789 (i) First fragment, 2400 and 2759 Gi Last fragment, 2400 and 2759 (iv) idee tragment, 300 and 639 Solution i) ‘Explanation: M= 0 indicates that this packet isthe last packet among all fragments of original packet. So the snoweriselther Aor Iti given that HLEN fled is 0, Header length is mumber of 3 bt words. Soheaderlength = 10.4 = 40 Als, given tat total length = 400, Teal length indicates total length of the packet including header So, packet length exchding header ~ 400-40 ~360 _Last byte address» 2400 +3601 » 279 (Because numbering tarts from 0). Trample 7; An router witha Maximum Transmssion Unit (TU) of 150 received an P pect fn 444 byes wit ni eade of enh 20 ye The wen ofthese fe 2aer ofthe third I fragment generated by the router for this packet are: ‘G) ME bit: 0, Datagram Length: 1444; Offset: 370 (i) Mr bits 2, Datagram Length: 1424; Offset: 185 (30M bite. Datagram length: 500; Ost 37 0, Datagram Length: 0 Datgram eng 14 Of 2960 ment, the last fragren, soresed Compute ewes NT Nenore Lay a Pret Explanation: ‘Number of packet fragments = total size of packet)/(MTU) 4404/1500 2.936 -3 ‘$0, Datagram with data 4404 byte fragmented into’ fragments. ‘Te fet frame carries bytes 0 to 2479 (because MTU is 1500 bytes and HLEN is 20 byte so the total bytesin fragments is maximum 1500-20=1480). The offset for this datagram is 0/8 = 0, ‘The second fragment caries byte 1480 to 2959, The offset for this datagram is 1480/8 «185. Finally the third fragment carries byte 2960 to 4404. The offset is 370.and for all fragments except lastone the Mbitis 1. Soin the third bit Mis 0, ‘Beample 8 An IP datagram of size 1000 bytes arrives at a router. The router has to forward this packet on a link whose MTU (maximum transmission unit) is 100 bytes. Assume that the sizeof the IP Iheader is 20 bytes, The numberof fragments thatthe IP datagram will be divided into for transmission is @ 10 50 (ay 2 Gv) 23, Solutions (¥) ‘Explanation: MTU =100 bytes SizeofIPheader= 20 bytes ° So, sizeof data that can be transmitted in one fragment =100~-20=80 bytes Size of data tobe transmitted» Size of datagram ~slze of header = 1000-20 = 980 bytes ‘Now, we have a datagram of size 1000 bytes. So, we need cell980/80) =18 fragments, there wil be 13 fragments of the datagram. Options + The header ofthe P datagram is made of two parts namely, a fixed part anda variable part. ‘+ The fixed part is 20 bytes long, and the variable part comprises the wh eer ‘part comprises the options, which can be a * Options, as the name implies, are not required fora datagram. They can. i equi tagram. They can be used for network testing, + Fig. 139 shows format of an option, 8 bt te the correct hole,

You might also like