introduction to networking - Ch.5 network Layer
Network Layer function
- Forwarding - move packets from router's input to appropriate router output
- Routing - determine route taken by packets from source to destination
Network vs Transport layer connection service
- network: between two hosts (may also involve intervening routers in case of VCs)
- Transport: between two processes
Virtual Circuits (Not Internet network)
- Like telephone calls
- performance-wise
- network actions along source-to-destination path
- Logical setup, not physically

Internet - datagram network
- data exchange among computers
- smart end systems - PC/servers
- many link types
- In Internet, Network layer is like this

Network mask (netmask)
- With flexible network/host part boundary, need to allow software in routers and hosts to identify where the division between the network number and the host number is.
- The mask is a 32-bit number where all bits in the network portion of the address are set to 1 and all bits in the host portion are set to 0
- E.g. 255.255.255.128=11111111.1111111.1111111.10000000 <-True
- E.g. 255.255.3.0=11111111.11111111.00000011.0 <-False, Since 1 is not contiguous
- subnetting is a procedure to multiple netmask(Above) by "AND gate" with IP address
- E.g. 192.168.1.123 AND 255.255.255.0 = 192.168.1.255
- Use to extract network-portion, divide networks
- Build Hierarchical addressing using subnetting

Looking up an IP address
For a given dest. IP address
- Search the routing table for the longest prefix match for the address.
- Extract the outgoing interface (or next-hop address.) from the routing table entry
- Send the packet to this outgoing interface (or next-hop addr. which may require recursive lookup(s))
- If no match was found, report that the destination is unreachable
CIDR (Classless InterDomain Routing)
- Reduce the shortage of Class B addresses
- Slow down the growth of routing table
How can your ISP - Internet Service Provider get block of addresses?
- Submit request to ICANN: Internet Corporation for Assigned Names and Numbers
NAT (Network Address Translation)
- Hide your network with private addresses
- One Location (E.g. an office) is just using one public IP address
- Have NAT translation table to map those IP addresses
Same external IP address, different source port numbers

ICMP: Internet Control Message Protocol
- Used by hosts, routers, gateways to communicate network-level information
- echo request/reply
- Code:

Router
- Run routing protocols
- forwarding datagrams from incoming to outgoing link
Switch
Three types of switches
- Memory
- Bus
- Crossbar

Performance
