2 1 3.3 CDS Wt 3.3 Network Layer CDS Wt hpe 2.3 Chapter Content Network Layer 3 Layer • • • • PProtocol IP 3 Introduction Layer IfrainBasedCommunication) (Information Matrix Communication Trains 3 Solutionin Layer Routing – Subnetting – Addressing schemes – IP-Header: www.ietf.org and RFC-760 – 4 3 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Protocol aspectoftheOSI-Model Why networklayer(1)? They define rules and formats of message/information exchange. ofmessage/information andformats rules They define Protocols are defined between the between Protocols aredefined nsse 1 Endsystem 1 2 3 4 5 6 7 transmission-system Layer 6protocol Layer 7protocol system Transit- 1 2 3 same layers oftwo systems. same layers nsse 2 Endsystem 1 2 3 4 5 6 7 6 5 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Locomotive Redundant nodes Redundant h ewr ae (2)? Why networklayer h ewr ae (3)? Why networklayer Dezentrale Display C MMI I/O media Multi- Subsystemes Dezentrale Motorr dez. I/O Control Main I/O Doors Türen steuerung Umrichter Antriebs- ONIX control Brake Single node Wagon: Dezentrale systeme Umrichter betriebe- Sub- Hilfs- I/O Climate control WTB trainbus (UICWTB 556)Standard! Subsysteme, Dezentrale MVB vehicle bus vehicle MVB Vehicle Bus(CAN, FIP,...) Vehicle Motor I/O Subsysteme, Dezentrale Climate Control Motor I/O Umrichter betriebe- Multiple Wagons Wagons Multiple Trainset: Hilfs- Vehicle bus Dezentrale systeme Control Sub- Brake I/O WTB/MVB Gateway Doors Türen steuerung Umrichter Antriebs- ONIX Control Main Subsysteme, Dezentrale dez. I/O dez. media motor Multi- I/O Display Dezentrale I/O MMI C reduntand Nodes reduntand Control-Wagon 8 7 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Network-Layer Network segmentation • • • The Network Layer... • protocol 3 known layer • best is the (IP) Protocol Internet • • • transfers destination via oneormore networks toa source a data sequences length from variable transferring of procedural means and provides thefunctional segment network andcontrol flow of traffic. canaccept it 2 fragmenting dataintosufficientlypackets thatLayersmall the data of connectionless transfer on an errors.Is based delivery report reassembly, and and fragmentation perform also might performs network routing functions, and layer. Transport service requested by the of maintains the quality • • systems. Autonomous a singleadministration - are managedby computernetworks Separate broadcast traffics. trafficsandreduce Control network packets logical addressing scheme rmoentokt another to from onenetwork 10 9 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Communication amongnetworks Router • • • • • behaviour Routers canchangethe mediaandLayer 2 incoming portsto a from Routers actually packets switch Layer 3information. on bestpathdecisionsbased Routers make Routers connectseparatenetworks. operateinmuchthesamemanner. Networks ppropriate outgoingports. 12 11 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Data relaying Path determination • based on the link bandwidth, hop,delaybased onthelinkbandwidth, ... path forthepackettotr router usestochoose Path determination istheprocess thatthe the nexthopin avel toitsdestination 14 13 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Network layer addressing Flat AddressingScheme 3 2 1 • Addressing Schemes. address+Hostaddress:Hierarchical Network A 3 – A 2 – A 1 – AB 3 2 1 B 6 – B 5 – B 4 – A 3 – A 2 – A 1 – 5 4 6 16 15 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt A drsig(ae 2) (Layer Addressing MAC Hierarchical AddressingScheme A3 A2 A1 A 3 – A 2 – A 1 – AB 3 2 1 Switch to B B – Local A – B2 B1 B3 18 17 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Hierarchical AddressingScheme Domestic • • • Switch network. manually orautomatically by managerofthat administrator. Hostaddressisassigned addressisassignedby higher-level Network within aninternetwork. identify thedestinationnetwork ofapacket addressto The routerusesthenetwork cloud. a path the network within The network addresshelps the routeridentify International Switch Local Gateway 84 89321044 20 19 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Content Network layer datagram • • • • • • layers. fromthehigher ispasseddown whatever and actualdata- other controlinformation- addressing and Packet includesheader- within layer, thedataisencapsulated At thenetwork Communication) Based (Information Matrix Communication Trains 3 Solutionin Layer Protocol IP 3 Introduction Layer Routing – Subnetting – Addressing schemes – IP-Header: www.ietf.org and RFC-760 – packets (also known asdatagrams). (also known 22 21 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt IP headerformat IP headerformat: • • • • IP currently used. Indicates theversionof 4 bits. IP currently used. Indicates theversionof 4 bits. – – – – IPv6 :0110 IPv4 :0100 IPv6 :0110 IPv4 :0100 Version 24 23 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt IP headerformat:Headerlength IP headerformat:Servicetype • • • • the beginningofdata. words (4bits),andthuspointsto lengthin32bit header datagram IP headerlength:Indicatesthe 4 bits. the beginningofdata. words (4bits),andthuspointsto lengthin32bit header datagram IP headerlength:Indicatesthe 4 bits. • • • • particular upper-layer protocol. particular a that hasbeenassignedby Specifies thelevelofimportance 8 bits. particular upper-layer protocol. particular a that hasbeenassignedby Specifies thelevelofimportance 8 bits. • • • • • • Speed. Reliability. Precedence. Speed. Reliability. Precedence. 26 25 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt IP headerformat:Totallength IP headerformat:Identification • • • • data andheader,inbytes. entire IPpacket,including Specifies thelengthof 16 bits. data andheader,inbytes. entire IPpacket,including Specifies thelengthof 16 bits. • • • • • • datagram. assembling thefragmentsofa Assigned by thesendertoaidin that identifiesthecurrentdatagram. Identification containsaninteger 16 bits. datagram. assembling thefragmentsofa Assigned by thesendertoaidin that identifiesthecurrentdatagram. Identification containsaninteger 16 bits. 28 27 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt • • • • • • • • IP headerformat:Flags IP headerformat:Fragmentoffset The firstfragmenthasoffsetzero. 8 octets(64bits). The fragmentoffsetismeasuredin unitsof datagram fragments. The fieldthatisusedtohelppiece together 13 bits. The firstfragmenthasoffsetzero. 8 octets(64bits). The fragmentoffsetismeasuredin unitsof datagram fragments. The fieldthatisusedtohelppiece together 13 bits. • • • • • • fragmented packets. is thelastfragmentinaseriesof The lastbitspecifying whetherthepacket packet canbefragmented. The secondbitspeci 3 bits. fragmented packets. is thelastfragmentinaseriesof The lastbitspecifying whetherthepacket packet canbefragmented. The secondbitspeci 3 bits. fying whetherthe fying whetherthe 30 29 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt • • • • IP headerformat:TimetoLive IP headerformat:Protocol completed incoming packetsafterIP processing hasbeen upper-la Indicates which 8 bits. completed incoming packetsafterIP processing hasbeen upper-la Indicates which 8 bits. • • • • • • • • 17 :UDP 06 :TCP 17 :UDP 06 :TCP packets fromloopingendlessly. the datagramisdiscarded,keeping gradually decreasesto Time-to-Live maintainsacounterthat 8 bits. packets fromloopingendlessly. the datagramisdiscarded,keeping gradually decreasesto Time-to-Live maintainsacounterthat 8 bits. yer protocolreceives yer protocolreceives zero, atwhichpoint zero, atwhichpoint 32 31 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt IP headerformat:Headerchecksum IP headerformat:Addresses • • • • • • • • • • helps ensureIPheaderintegrity. only, header onthe A checksum 16 bits. helps ensureIPheaderintegrity. only, header onthe A checksum 16 bits. Destination IPAddress Source IPAddress 32 bitseach. Destination IPAddress Source IPAddress 32 bitseach. 34 33 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt IP headerformat:Options IP headerformat:Padding • • bit boundary. that theinternetheaderendsona32 toensure isused padding The header bit boundary. that theinternetheaderendsona32 toensure isused padding The header • • • • such assecurity, route,error report... Allows IPtosupportvariousoptions, Variable length. such assecurity, route,error report... Allows IPtosupportvariousoptions, Variable length. 36 35 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Content IP networkaddress • • • • • • • Network IDandHostID. Network components: The IP addresshastwo decimal format. The arepresentedasfouroctetsindotted layeraddresses Network Communication) Based (Information Matrix Communication Trains 3 Solutionin Layer Protocol IP 3 Introduction Layer Routing – Subnetting – Addressing Schemes – IP-Header: www.ietf.org and RFC-760 – are 32bitslong. are 38 37 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Network IDandhost Bits ontheIPaddress • • • • Host Bits: Bits: Network Host ID: ID: Network All ofbitsare 1: reserved for broadcast address – All ofbitsare 0: reserved for network address – Identifies host ID – All ofbitsare 0: not allowed – Identifies class of the IP address – Identifies network ID – Identifies the specific device onthat network. – Assigned by a network administrator. – Identifies the network to which a devices isattached. – Assigned by upper organization. – Assigned byInternet Network Information Center. – 40 39 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt IP addressclasses IP addressclasses:ClassA • • different sizenetworks Provide theflexibility requiredtosupport portions oftheaddress andHost amounts ofbits fortheNetwork different Different classaddressesreserve 42 41 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt IP addressclasses:ClassA IP addressclasses:ClassB • • • • • possible IPaddresses. haveupto16,777,214 Each classAnetwork the hostportionofaddress. beusedfor The remainingthreeoctetscan 127.0.0.0. addr Possible network the address. The first8 bits to identify thenetwork part of 0. isalways The firstbitofaClassAaddress ess from1.0.0.0to 44 43 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt IP addressclasses:ClassB IP addressclasses:ClassC • • • • • IP addresses. have Class Bnetwork host portionoftheaddress. The remaining two octets canbeusedfor the 191.255.0.0. addressfrom128.0.0.0 to Possible network part oftheaddress. octetstoidentifyThe firsttwo thenetwork 10. isalways The first2bitsofaClassBaddress up to65.534possible 46 45 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt IP addressclasses:ClassC IP addressclasses:Summary • • • • • • • • • • • >= 240.0.0.0:ClassE, reserved. 224.0.0.0 <240.0. 223.255. 192.0.0.0 - 191.25 128.0.0.0 - 127.0.0.0 :Loopbacknetwork. 126.0.0.0 :ClassA. 1.0.0.0 - addresses. haveup Class Cnetwork host portionoftheaddress. The remaininglastoctetcanbeusedforthe 223.255.255.0. addressfrom192.0.0.0 to Possible network part oftheaddress. The firstthreeoctetsto identify thenetwork 110. isalways The first3bitsofaClassCaddress 0.0 :ClassD,multicast. 5.0.0 :ClassB. 255.0 :ClassC. to 254possibleIP 48 47 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Network address Broadcast address • • • • • • broadcast address. bits andhostbitsis bina An IPaddresswith broadcast address. forthedirected host bitsisreserved binary 1sinall An IPaddressthatendswith IDnumber. particular network hostwitha goestoevery Broadcast address. forthenetwork host bitsisreserved binary 0sinall An IPaddressthatendswith communicate. require adevice,typically hosts address differingnetwork Two with orsubnetwork. network refer toall ofthead addressprovideaconvenientway to Network dresses onaparticular reserved forthelocal ry 1sinallnetwork arouter,in order to 50 49 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Local broadcastaddress Directed broadcastaddress Broadcast address Broadcast address 255.255.255.255 192.168.20.255 192.168.20.0 STOP 52 51 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Example: 172.16.20.200 Private addresses • • • • • • • • • • Class C:192.168. Class B:172.16. Class A:10.0.0.0. connections tothe globalInternet. butdonotrequireexternal network, IP connectivity theirenterprise within Internet addressspaceforhoststhatrequire Organizations makeuseoftheprivate According toRFC-1918. address:172.16.255.255 Broadcast address: Network Host portion: portion:172.16 Network 172.16.20.200 isClassBaddress 20.200 . 172.31.0.0. 0.0 - . 192.168.255.0. 0.0 - 172.16.0.0 54 53 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Content Why todivide network? weneed • • • • • • our network asasinglenetwork. our network see theoutsidenetworks ButI network. want addressesforyour needmorenetwork So we smaller networks: especiallydivide networks, largeones,into administrators sometimesneedto Network Communication) Based (Information Matrix Communication Trains 3 Solutionin Layer Protocol IP 3 Introduction Layer Implement the hierarchical managements. – Improve network security. – Reduce the size of a broadcast domain. – Routing – Subnetting – Addressing Schemes – IP-Header: www.ietf.org and RFC-760 – 56 55 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Divide networkby three Subnetting • • • • usually by anetwork administrator. assignedlocally, Subnet addressesare subnet field. host portionanddesignatesthemasthe administrator borrows bi To createasubnetaddress,network field andahostfield. por B, orClassCnetwork Subnet addressesincludethe ClassA, network. divisions of aresmaller ts from the original tion, plusasubnet 58 57 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Subnetting Subnet mask • • • • • • Host portionsall0’s. and Subnet portions all1’s. Network Divided intofouroctets. 32 bitslong. fieldand network which Determines which partof Prefix”. Network “Extended part isthehostfield. an IPaddressisthe 60 59 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Default subnetmask:Example Subnet mask:Example • • • • • • • • • • • • Class Bnetwork: 10101100.00010 11111111.11111 10101100.00010 172.16.65.100 /255.255.240.0. Subnet address:192.168.2.0. Class Cnetwork: 11000000.10101 11111111.11111 11000000.10101 192.168.2.100 /255.255.255.0. Subnet address:172.16.64.0. 12bitsfor host portion. – bitsfor 4 subnet portion. – 16bitsfor network portion. – bitsfor 8 host portion. – bitsfor 0 subnet portion. – 24bits for network portion. – 000.0100000 111.1111000 000.0100000 000.0000001 111.1111111 000.0000001 1.01100100. 0.00000000. 1.01100100. 0.01100100. 1.00000000. 0.01100100. 62 61 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt Address How many bits can Iborrow? bitscan How many Why weneedtoknowBooleanops? IP • • • • • • • • • :0 is~26-2 = C: 06bits ~206- 2 = B: 14bits ~214- 2 A: 22bits ~222- is: The maximumbitsyou canborrow 2 bits. is: The minimumbitsyou canborrow All ofsubnetbitsare: – 1 : reserved 1 for broadcast address. – 0 : reserved for network address. – Example: a subnet operations inordertofi layer performstheBoolean Network Network address: 172.16.64.0 – 172.16.65.100 AND255.255.240.0 – AND Subnet Mask = 4.194.302subnets. 16.382subnets. = 62subnets. nd the network IDof nd thenetwork Subnet address Network and 64 63 3.3 Network Layer CDS Wt 3.3 Network Layer CDS Wt flooded broadcasts. flooded and broadcasts directed - broadcasts kindsof Two address IP the of portion a within 1s all using by formed is address The broadcast anetwork. on host by every seen tobe intended are messages Broadcasting broadcasts. broadcasts. local considered are but propagated, arenot (255.255.255.255) broadcasts Flooded address. the of portion host the in 1s all contain broadcasts directed These router. bythe forwarded andare allowed are network/subnet aspecific into directed Broadcasts P ofn A Address APR tofindaMAC drs l oe (braodcast) nodes all Address