4.4 Subnets
Communication internal, able without router. |
Amount of IP bits must match, indicated by /x on address, x is amount of bits for matching in subnet, rest used for host. |
Sometimes can be represented using an IP address, in binary all bits that are 1 are the amount for subnet. |
4.4 NAT
In routers, has public and private addresses, wraps private address in public NAT. |
Private addresses either 10.0.0 or 192.168.1. |
NAT makes forwarding table, associates internal IP and port with NAT IP and new chosen NAT port. |
Each socket will have its own entry. |
4.4 Adressing
Addressing is dotted decimal, a.b.c.d, each decimal separating a byte. |
Roughly 2^32 addresses with IPv4. |
DHCP, Interfaces, ICMP
DHCP is client/server setup, assigns IP from pool, releases once host is done. |
Interfaces: a connection with a host/router and link, associated with IP addresses. |
ICMP, protocol, error communication, above IP |
Forwarding Table
Tells you what link to send to based on destination IP. |
Splits the destination IPs into ranges in the forwarding table. |
Choose range with longest match. |
To make, split destination IP ranges by looking at where bits deviate. |
4.5 Types of Routing Algorithms
Global |
All routers have the knowledge of the network system. Link state algorithms. Dijkstra's algorithm. |
Decentralized |
Routers only know information about neighbors. Learns network through neighbors. Distance vector algorithms. |
Static |
Changes slowly over time. |
Dynamic |
Changes more quickly. |
|
|
4.1-4.3
What does network layer do? Transports segments, wraps segments in datagram, in every host, uses IP. |
How do routers work? Use routing algorithm to create forwarding table. Move datagrams from input to output, use switching fabric. Works on layer 3. |
Key network functions: Routing: Determine the route to dest. Forwarding: Deciding the correct output port to send a packet on. Forwarding tables tell router where to send datagram. |
Hierarchical Routing
Divide network into small groups. A router is chosen as gateway to outside networks. All routers in group run same routing algorithm. |
4.4 classful IP and CIDR
Class A: |
8 bits network, 24 bits host. |
Class B: |
16 bit network, 16 bits host. |
Class C |
24 bit network, 8 bits host. |
Classless (CIDR): |
allows any choice of # bits for network. |
4.4 Fragmentation
Break data to fit on link. |
Formula for fragmenting datagram: ceiling (datagram – IP header / MTU – IP header) |
Formula for fragmenting raw data: ceiling (bytes / MTU – IP header – transport layer header) |
4.4 IPv6
Removed fragmentation. Increased address size to 128 bits. 40 byte fixed header. |
Version: IP version. |
Traffic class: type of traffic. |
Payload length: how much data. |
Next header: upper layer protocol to deliver to. |
Hop limit: how many hops allowed. |
Source and dest. addresses: 128 bits. |
Data: what data is transported. |
4.4 IPv4
Protocol version: |
what version running. |
Header length: |
length of header, fixed 20 bytes + optional field. |
Type of the data: |
Different types of datagrams exist. |
Datagram length: |
data + header |
Identifier: |
identify fragments of IP datagram, data from same datagram has same number |
Flags: |
indicate beginning of fragmentation or if allowed, uses 3 bits. First bit always 0. Second bit is 0 or 1, 0 means fragment, 1 means can’t. Last bit 0 or 1, 0 means no more fragments, 1 means more. |
Offset: |
used to rebuild fragment. |
Time to live: |
How many hops before dropped, resets at router, drop at 0. |
Upper layer: |
upper layer protocol to pass to. |
Header checksum: |
check for errors |
Source and dest. IP: |
32 bits. |
Data: |
data carried. |
Options: |
allows increase in header. |
|
|
5.1 Link layer
What is it? |
Getting messages from one link to next, one hop communication. |
How does info change? |
From link to link. |
What are transmission units? |
Frames. |
5.1 Link layer services
Framing: putting datagrams into frames. |
Link Access: rules for multiple users accessing link. |
Reliable delivery: uses re-transmissions and ACKs. For direct connection links. Only used on error prone links. |
5.3 Types of links
Point to ponit |
Broadcast: many users share link. |
Wireless |
5.3 MAC protocols
MAC protocols allow link sharing. |
Channel partitioning: No collisions, communicate on time intervals. |
Random access: if collisions, randomly choose time to resend. |
5.4 MAC addresses
MAC is fixed. IP can change. |
MAC 48 bits, in hex |
Host has both MAC and iP. |
Ethernet Frames
Preamble |
Wakes up the receiver for transmission. |
Source and Dest MAC |
tell you sender and receiver, 48 bits, hex. |
Payload |
Must be between 46-1500 bytes, data sent. |
Error correction |
Type |
Tells you the upper layer protocol. |
Ethernet topology
Bus |
hosts connect to same link. |
Star |
hosts connect to switch, switch moves traffic, reduces traffic to router, forwards within subnet, uses MAC address. |
|
|
5.4 ARP
Maps MAC to IP |
Above link layer, below network layer. ARP packets carried by link layer. |
Creates tables to map IP and MAC. Entries last approx. 20 mins. |
5.4 ARP sending in subnet
Check ARP table for mapping. |
If mapping is there, send frame. |
If mapping not there, ARP query. |
Broadcast ARP query for who has an IP. |
Host with IP responds directly to query host. |
Table updated with MAC/IP mapping. |
5.4 ARP sending outside subnet
Can't have destionation's MAC. |
Use MAC for next hop link (router) as destination MAC. |
Source IP and Dest IP stay same. Source MAC and Dest. MAC change. |
Switches
Operates on layer 2, link layer device, transparent to host (no IP or MAC). |
Self learns by recording interface and MAC of sent frames that cross it. Builds own forwarding table. |
If no entry in forwarding table, broadcasts frame to all interfaces. Those with the wrong MAC drop it. |
|