Documente Academic
Documente Profesional
Documente Cultură
Contents
Basics Internetworking Devices Network Layer Protocols Transport Layer Protocols Application Layer Protocols
Internet Protocols
Repeaters electronic devices that receive signals and regenerates and send them along the network Hub electronic device (with a number of ports) used in a LAN to link/connect groups of computers Bridge consists of hardware and/or software that allows communication between two similar networks Routers - electronic devices used to ensure messages are sent to their intended destinations Gateway consists of hardware and/or software that allows communications between dissimilar networks
This NIC has interfaces for twisted pair, thicknet, or thinnet connectors.
Repeaters
Signal attenuation or signal loss signal degrades over distance Repeaters clean, amplify, and resend signals that are weakened by long cable length. Built-in to hubs or switches
Hubs
OSI layer 1 hardware Hubs regenerate network signals Hubs propagate signals through the network They cannot filter network traffic They cannot determine best path They are used as network concentration points They are really multi-port repeaters
Bridges
A layer 2 device designed to create two or more LAN segments, each of which is a separate collision domain. The purpose is to filter traffic on a LAN, to keep local traffic local, yet allow connectivity to other segments of the network. Filter traffic by looking at the MAC address Frame filtering
Bridges
If the frame is addressed to a MAC address on the local side of the bridge, it is not forwarded to the other segment MAC addresses on the other segment are forwarded Bridges maintain a MAC address table for both segments they are connected to
Cycle of bridges
Bridged network can span many segments Broadcasts are sent to all segments
If all bridges forward broadcasts, infinite loops can occur Bridges perform DST on boot to determine which bridges will not forward broadcasts
Local Internetworking
A configuration with four LANs and two bridges.
(a) Interconnected LANs. (b) A spanning tree covering the LANs. The dotted lines are not part of the spanning tree.
Remote Bridges
Remote bridges can be used to interconnect distant LANs
Switched Networks
Shared Ethernet networks perform best when kept to 30-40 percent full capacity This is a result of CSMA/CD A LAN switch is a high-speed multiport bridge which segments each port into its own collision domain and can access the full bandwidth
Collision Domain
A collision domain is a logical network segment where data packets can collide with one another for being sent on a shared medium, in particular in the Ethernet networking protocol
Broadcast Domain
A broadcast domain is an area of the computer network made up of all the computers and networking devices able to be reached by sending a frame to the data link layer broadcast address Routers and Layer-3 Switches are used to segment broadcast domains
Switches
Each port is a simulated segment to itself Illusion of a separate LAN segment to other segments by bridges
Do error checking on each frame after the entire frame has arrived into the switch If the error checking algorithm determines there is no error, the switch looks in its MAC address table for the port to which to forward the destination device Highly reliable because doesnt forward bad frames Slower than other types of switches because it holds on to each frame until it is completely received to check for errors before forwarding
Faster than store and forward because doesnt perform error checking on frames Reads address information for each frame as the frames enter the switch (first 14 bytes for Ethernet frame) After looking up the port of the destination device, frame is forwarded Forwards bad frames
Performance penalty because bad frames cant be used and replacement frames must be sent which creates additional traffic
Combines speed of cut through switch with error checking functionality Forwards all frames initially, but determines that if a particular port is receiving too many bad frames, it reconfigures the port to store and forward mode Preferred switching solution
Layer 3 switch
By definition a switch filters or forwards frames based on MAC addresses. This makes a switch a layer 2 device. Layer 3 switches have routing capability. If a data frame cant be switched it is routed. Each port is a separate LAN port, but the forwarding engine actually calculates and stores routes based on IP addresses, not MAC addresses Usually support only IP or IP and IPX
VLAN Switches
Virtual local area network Each port on a switch defines a collision domain The entire switch forms a single broadcast domain VLANs can define multiple broadcast domains Network traffic that is directed to all computers on the network can be segmented to transmit only on a specific VLAN. Improves bandwidth on a the VLANs because each VLAN filters the network-to-network broadcast traffic as well as the collision traffic from other VLANs
Physical layer broadcasts implemented by non-switched Ethernet networks through shared cabling and hubs
Each bit that is transmitted is physically received by every station Switches and VLANs dont do physical layer broadcasts
MAC-level broadcast
MAC-level broadcast deal with how to handle MAC level broadcast frames; that is the data frames that have a broadcast destination MAC address MAC-level broadcast frames are addressed to all MAC addresses on a given network (not a network segment, but an actual network as defined by its network address) A regular switch forwards all broadcast frames out all ports, but a VLAN switch forwards broadcast frames only to ports that are part of the same VLAN Multiple switches can be part of the same VLAN
VLAN Switches
None of the VLANs can communicate unless each VLAN is connected to a router or layer 3 switch Each VLAN is separating collision traffic associated with MAC Addresses (layer 2) and each VLAN is separating the network-tonetwork broadcast traffic. In other words each VLAN is acting as a separate network so a layer 3 device is necessary for them to communicate
Advantages of Switches
Switches divide a network into several isolated channels (or collision domains) Reduce the possibility of collision
Collision only occurs when two devices try to get access to one channel Can be solved by buffering one of them for later access
33
Brouters
Hybrid device Functions as a router for routable protocols Functions as a bridge for non-routable protocols Operates at Data Link and Network layers
Gateways
A gateway is a combination of hardware and software Translate between different protocol suites Operates on all 7 layers of the OSI model Most negative on network performance
Latency
Network Layer
The IP Protocol
The IPv4 (Internet Protocol) header.
IP Addresses
IP address formats
IP Addresses (2)
Special IP addresses
Subnets
A campus network consisting of LANs for various departments.
Subnets (2)
Subnet Masks
The simplest form of subnet masking uses a technique called constant-length subnet masking (CLSM), in which each subnet includes the same number of hosts and represents a simple division of the address space made available by subnetting into multiple equal segments
Another form of subnet masking uses a technique called variable-length subnet masking (VLSM) and permits a single network address to be subdivided into multiple subnets, in which subnets need not all be the same size
44
Subnetting Example 1:
An large organization is assigned with the network address 190.10.0.0/16. It needs to support about 150 subnets for different locations. In each subnet, it needs to support about 200 hosts. As the first step, decide the number of bits needed from host bits to represent the subnet ID.
45
Subnetting Example 1:
Subnet mask: 255.255.255.0 Possible subnets: 2^8 => 256 Possible hosts per subnet: 2^8 - 2 => 254 Addresses of subnetworks:
A typical host address is 190.10.0.x where x = 1 to 254 (eg: 190.10.0.5), with a subnet mask of 255.255.255.0 Also written as: 190.10.0.5/24 (without having to write the subnet mask) - Binary Count notation 24 identifies the number of contiguous 1 bits in the subnet mask and is called the length of the Extended-Network-Prefix Directed broadcast addresses of subnet #0:
190.10.0.255
47
A limitation of having only a single subnet mask across a given network-prefix is that once the mask is selected, it locks the organization into a fixed number of fixed-sized subnets. In Subnetting Example 1 (subnetting 190.10.0.0 using 8 bits of the host id), there are 256 possible subnets with 254 hosts each.
A solution is to allow a subnetted network to use more than one subnet mask
48
VLSM Example:
An organization is assigned the network number 140.25.0.0/16. It plans to divide the address space into 16 equal sized blocks (subnets 0-15), and then to subdivide subnet #14 into 16 equal-sized blocks. Using 4 bits for subnet id, 16 subnets of the 140.25.0.0/16 address block are:
Base net: Subnet #0: Subnet #1: . Subnet #14: Subnet #15: 10001100.00011001.00000000.00000000 10001100.00011001.00000000.00000000 10001100.00011001.00010000.00000000 10001100.00011001.11100000.00000000 10001100.00011001.11110000.00000000 = 140.25.0.0/16 = 140.25.0.0/20 = 140.25.16.0/20 = 140.25.224.0/20 = 140.25.240.0/20
49
Using 4 more bits for sub-subnet id, 16 sub-subnets of Subnet #14 are:
Subnet #14: 10001100.00011001.11100000.00000000 = 140.25.224.0/20 Subnet #14-0: 10001100.00011001.11100000.00000000 = 140.25.224.0/24 Subnet #14-1: 10001100.00011001.11100001.00000000 = 140.25.225.0/24 . Subnet #14-14: 10001100.00011001.11101110.00000000 = 140.25.238.0/24 Subnet #14-15: 10001100.00011001.11101111.00000000 = 140.25.239.0/24
50
IETF introduced a new way to carve up the IP address spaceClassless Inter-Domain Routing (CIDR) RFC 1918 reserves three ranges of IP addresses for private use
When used together with Network Address Translation (NAT), private IP addresses can help lift the cap on public IP addresses
51
Abandons the rigid address classes to eliminate the inefficiency in classful addressing CIDR ignores the traditional A, B, and C class designations for IP addresses, and can therefore set the network-host ID boundary wherever it wants to. To use a CIDR address on any network, all routers in the routing domain must understand CIDR notation
52
Route Aggregation: Use of a single entry in a routing table to represent address space of several networks Reduces the size of routing tables in routers Using contiguous blocks of Class C addresses to simulate a single, large address space
Documented in RFCs 1517 to 1520 Eg: 192.125.61.8/20 identifies a network with a 20bit network prefix
53
Network
Cambridge
Edinberg Oxford
194.24.0.0
194.24.8.0 194.24.16.0
21
22 20
Eth0
Eth1 Eth2
Consider a packet with 194.24.17.4. Compare to all the entries and use longest matching entry Routing Table at Router 2 Address Cambridge Edinberg 194.24.0.0 194.24.8.0 Mask 21 22 Interface Eth0 Eth0
Oxford
Aggregated Routing Table at Router 2 All
194.24.16.0
Address 194.24.0.0
20
Mask 19
Eth0
Interface Eth0
Supernets
Supernetting takes the opposite approach to subnetting: by combining contiguous network addresses, it steals bits from the network portion and uses them to create a single, larger contiguous address space for host addresses Example: An organization has the following contiguous Class C addresses
212.56.132.0/24
212.56.133.0/24 212.56.134.0/24
212.56.135.0/24
57
Supernets
Motivation: demand for IP addresses increases with the arrival of small devices. NAT solution: local network uses just one IP address as far as outside world is concerned allocate addresses to devices in local network without notifying outside world can change ISP without changing addresses of devices in local network devices inside local net not explicitly addressable, visible by outside world (a security plus). widespread use Private IP addresses: 10.0.0.0 - 10.255.255.255 172.16.0.0 - 172.31.255.255 192.168.0.0 - 192.168.255.255
59
10.0.0.2
All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, different source port numbers
Datagrams with source or destination in this network have 10.0.0.0/8 address for source, destination (as usual)
60
10.0.0.1
10.0.0.4
S: 128.119.40.186, 80 D: 10.0.0.1, 3345
10.0.0.2
138.76.29.7
S: 128.119.40.186, 80 D: 138.76.29.7, 5001
10.0.0.3 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345
61
NAT Implementation
Private Addr Private Port External Addr External Port NAT Addr NAT Port
nb-addr nb-addr
nb-port1 nb-port2
yahoo dns.sjsu
80 53
gw-addr gw-addr
3001 3002
tcp udp
nb-addr
pc-addr
nb-port3
pc-port1
yahoo
yahoo
80
80
gw-addr
gw-addr
3003
3004
tcp
tcp
remember (in NAT translation table) every (src IP addr, port #) to (NAT addr, NAT port #) translation pair incoming: replace (NAT addr, NAT port #) in dest fields of every incoming datagram with corresponding (src IP add, port #) stored in NAT table
62
IP companion protocols
Internet Control Messaging Protocol (ICMP) Internet Group Management Protocol (IGMP) Address Resolution Protocol (ARP) Reverse Address Resolution Protocol (RARP)
65
66
Features of IPv6
Larger Address Space Aggregation-based address hierarchy Efficient and Extensible IP datagram Security (IPsec mandatory) Mobility
Header comparison
0 vers hlen identification 20 bytes TTL protocol 15 16 TOS flags total length flag-offset 31
Removed (6)
ID, flags, flag offset TOS, hlen header checksum
header checksum
Changed (3)
total length => payload protocol => next header TTL => hop limit
IPv4
vers traffic class flow-label next header hop limit
Added (2)
traffic class flow label
payload length
40 bytes
source address
destination address
Expanded
address 32 to 128 bits
IPv6
Simpler format than v4 Version = 6 Traffic class same as v4 ToS Treat all packets with the same Flow Label equally
Hop limit = TTL field Next header combines options and protocol
70
No checksum
Bit level errors are checked for all over the place Fixed format speeds processing
Incorrectly sized packets are dropped and message is sent to sender to reduce packet size Hosts should do path MTU discovery But of course we have to be able to segment packets!
71
Extension Headers
Routing Extended routing, like IPv4 loose list of routers to visit Fragmentation Fragmentation and reassembly Authentication Integrity and authentication, security Encapsulation Confidentiality Hop-by-Hop Option Special options that require hop-by-hop processing Destination Options Optional information to be examined by the destination node
Fragmentation Extension
Similar to v4 fragmentation
Placed between v6 header and data (if it is the only extension used)
reserved
73
Routing Extension
Without this header, routing is essentially the same as v4 With this header essentially same as the source routing option in v4
Loose or strict
Segmnts left
74
Transition from v4 to v6
Dual stack operation v6 nodes run in both v4 and v6 modes and use version field to decide which stack to use
Allows a host which supports v6 to talk v6 even if local routers only speak v4 Signals the need for tunneling Add 96 0s (zero-extending) to a 32-bit v4 address eg. ::10.0.0.1 Allows a host which supports both v6 and v4 to communicate with a v4 hosts Add 2 bytes of 1s to v4 address then zero-extend the rest eg. ::ffff:10.0.0.1
Tunneling is used to deal with networks where v4 router(s) sit between two v6 routers
Simply encapsulate v6 packets and all of their information in v4 packets until you hit the next v6 router
75
Transport Layer
A state diagram for a simple connection management scheme. Transitions labeled in italics are caused by packet arrivals. The solid lines show the client's state sequence. The dashed lines show the server's state sequence.
Transport Protocol
(a) Environment of the data link layer. (b) Environment of the transport layer.
Addressing
TSAPs, NSAPs and transport connections.
Connection Establishment
How a user process in host 1 establishes a connection with a time-of-day server in host 2.
Connection Establishment
Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. (a) Normal operation, (b) Old CONNECTION REQUEST appearing out of nowhere. (c) Duplicate CONNECTION REQUEST and duplicate ACK.
Connection Release
Connection Release
Four protocol scenarios for releasing a connection. (a) Normal case of a three-way handshake. (b) final ACK lost.
6-14, a, b
Connection Release
(c) Response lost. (d) Response lost and subsequent DRs lost.
6-14, c,d