Network interconnection: Repeaters, bridges, routers, gateways Repeaters: the simplest interconnection devices, connect networks of the Repeater same architecture at the Segment A physical layer, and more Segment B higher layers. Ethernet Amplifier segments Transceiver Any signal in one segment is repeated in another segment, Segm. B and vice versa. No filtering at Segm. A all. Bridges: connect LANs at the data link layer. Reasons for using bridges: 1. Connect departmental small LANs into a layer (campus) LAN. 2. Connect geographically spread LANs (LANs in different buildings). 3. Splitting a load of the LAN among its different parts. 4. Too long distance between workstations (more than 2.5 km for 802.3). 5. Reliability aspect. 6. Isolating sensitive traffic (security aspect). Backbone LAN B LAN 1 Bridge LAN 2 B LAN 3 1 Operation of a LAN bridge from 802.3 to 802.4 Host A From higher layer PKT LLC Phys. LLC Bridge PKT PKT PKT PKT MAC Host B For 2 ports 802.3 PKT 802.3 PKT 802.4 PKT 802.4 PKT 802.3 PKT 802.3 PKT 802.4 PKT 802.4 PKT CSMA/CD LAN 802.4 Token bus LAN PKT LLC header MAC header 802.4 802.4 PKT Data PKT Frame Problems: 1. Each of the 802.x LANs uses its own frame format. 2. Interconnected LANs run at different data rate (buffering is necessary). 3. Most important: three 802.x LANs have different maximum length. No solution in 802.x: large frames are discarded!!! 4. There are 9 combinations of 802.x to 802.y bridges. 2 More details about bridges Architecture: DB Bridge protocol & buffers Station ddr. . . . . . . . . . . . . . . . . . . MAC chipset LAN 1 Port1 Port2 Port . . . . . . . . . . . . LAN 2 Stations 3 An example: All stations on different LANs have unique address DB DB Station Port Station Port addr. numb. addr. numb. 1 1 1 1 Bridge1 Bridge2 2 1 2 1 3 2 3 2 4 2 4 2 5 2 5 2 6 2 6 2 Ethernet Ethernet Port1 Port2 Port1 Port2 Ethernet LAN A LAN B LAN C 1 2 3 Stations 4 Stations 5 6 Stations Logically, this is one large LAN Functions of bridge 1(A-to-B): 1. Read all frames on LAN A, accept those addresses to stations on LANs B, C. 2. Using the MAC protocol for LAN B, retransmit accepted frames on LAN B. 3. The same for B-to-A traffic. 4 Transparent (spanning tree) bridge LAN 1 Bridge1 A LAN 2 Port1 Port2 Bridge2 B Port1 Port2 Port3 LAN 3 D C E 1. Initially, a bridge contains no info about stations. 2. A bridge accepts every frame transmitted on all the LANs to which it is attached. 3. When a frame arrives, a bridge must discard or forward it. If forward, then: to which LAN ? A frame arrived on some port Destination and source LANs are the same ? No No Destination LAN is unknown ? Forward the frame to the corresponding port Yes Discard the frame Yes Forward the frame to all ports except the port at which it arrived 5 Operation of bridge 2 (initially bridge table is empty) Bridge table Transmissions Frame Port At which the from # frame arrived host 1. C E C 3 Forward frame to ports 1, 2 2. E C E 3 Discard frame 3. B D B 1 Forward frame to ports 2, 3 4. A D A 1 Forward frame to ports 2, 3 5. D A D 2 Time Forward frame to port 1 6. A D Forward frame to port 2 6 Firewalls (see textbook, pp. 410-411) A castle A bridge A deep moat High-level checking Application gateway A network being guarded by the firewall Packet filtering router (for incoming messages) A firewall Packet filtering router (for outgoing messages) 7 Routers (sometimes called gateways). Main purpose: to interconnect different networks at the network layer. Using: in WANs. Two classes of routers (according to the OSI model): Connection-oriented Connectionless Connection oriented routers A full router Net 1 to Net 2 to internet Buffers internet Internet Internet to net 1 to net 2 Network 1 Network 2 Machine for both networks Two halfNetwork routers 1 Machine 1, within network 1 Host A Net 2 to internet Internet to net 1 Internet to net 2 Communication line (X.75 protocol or X.25) Router 1 Router 2 3 3 3 2 2 1 1 Network1 Net 1 to internet X.75 X.75 X.75 Network 2 Machine 2, within network 2 Host B 3 2 2 1 1 Network2 8 Network 2 Network 1 A VC1 VC2 R R R VC3 R R Source host VC4 Network 3 R B VC5 R Concatenated virtual circuits between hosts A and B via a number of routers in three networks. All routers are connectionoriented. Source host datagram R A A router R A table of virtual circuits R R R R R Destination host datagram R R R B Connectionless routing (using datagrams) Destination host 9 Datagrams moving through different networks Host A 4 msg 3 IP msg 2 frame 1 Router 1 Router 2 IP msg IP msg frame 2 frame 3 frame 2 Host B msg IP msg frame 3 frame 3 1 Network 1 Network 2 frame 1: MAC1 IP msg frame 2: : frame 3: MAC2 IP msg Network 3 msg – a message from the transport layer IP – layer 3 header (IP header) MACi – data link header for the network i MAC3 IP msg Problems: Different networks have different maximum size of a packet. So the fragmentation (and reverse process) is necessary. Two approaches to fragmentation: 1. Transparent fragmentation Network packet R To next network R This router reassembles the fragments (one router for all fragments!) This router fragments a large packet 2. Non-transparent fragmentation Large packet Network R R To next network R 10 Software architecture for bridges and routers Main requirement is high performance. A bridge Let there be a continuous flow LAN1 of packets from LAN1 to LAN2 10 Mbps, A packet 64 bytes in packets generated 1 51 sec 51 sec LAN2 51 sec 20 000 packets/sec time A bridge (or a router) as a set of processes Processes: 1, 3, 5 – with the highest priority. 8, 9 – with the lowest priority. Bridge LAN1 Design issues: 1. Using the single address space. 2. IPC – by use of LAN 1 shared memory. 3. Scheduling: let each process run to completion. 4. Disable interrupts (use a polling approach). LAN3 LAN2 Statistics Management LAN3 LAN2 11