Recent Changes - Search:

Distributed Computing

This website demonstrates using wikis as teaching and learning tool.

The course instructor is also happy to share the teaching materials here with those who find it readable.

Networking Basics

A Distributed Computing Lecture by Steven Choy

Lecture Overview: Protocols and networking stacks - Internet Protocol - IP addressing and networks - TCP (Transmission Control Protocol) - UDP (User Datagram Protocol) - IP family of services - Domain Name System - Firewalls and proxy servers - Internet Protocol version 6 - Overview of basic concepts for network programming


Protocols and networking stacks

  • OSI (Open Systems Interconnect) 7-layer model
    • Application (e.g. FTP, telnet, HTTP)
    • Presentation (e.g. XNS)
    • Session (e.g. RPC)
    • Transport (e.g. TCP, UDP)
    • Network (e.g. IP, AppleTalk)
    • Datalink (e.g. Ethernet frames)
    • Physical (e.g. voltages)

I used this sentence to remember these seven layers:
All People Seems To Need Data Processing

Viewing more about OSI model...
The 7 Layers of the OSI Model - Webopedia - Illustration
OSI model - Wikipedia
OSI Model Illustrated

  • IP (Internet Protocol) suites
    • Application (e.g. FTP, telnet, HTTP)
    • Transport (e.g. TCP, UDP)
    • Network (e.g. IP)
    • Datalink (e.g. Ethernet frames)
    • Physical (e.g. voltages)
  • Encapsulation - embed a layer's packets into packets of layers immediately below it (vs. Decapsulation)

Illustration: The OSI Model

Internet Protocol

  • IP - host addressing scheme in network & packet routing scheme amongst hosts
  • Usually work with TCP (Transmission Control Protocol) or UDP (User Datagram Protocol)
  • IPv4: 32-bit Internet address x.x.x.x
    • Specify the network id (netid) and the host id (hostid)
  • What is your IP address?
If you are using Windows, type ipconfig or ipconfig /all in the Command Prompt. It will then list the host name, IP address, subnet mask, gateway, and even the MAC address of your network card.
If you used a router/proxy, your IP address as seen by the server is different. Try the following websites.
Why?
Public versus private IP addresses: Besides the reserved IP addresses (0.0.0.0/8 and 127.0.0.0/8) mentioned above, there are other addresses not used on the public Internet. These private subnets consist of private IP addresses and are usually behind a firewall or router that performs NAT (network address translation). NAT is needed because private IP addresses are nonroutable on the public Internet, so they must be translated into public IP addresses before they touch the Internet. Private IPs are never routed because no one really owns them. And since anyone can use them, there's no right place to point a private IP address to on the public Internet. Private IP addresses are used in most LAN and WAN environments, unless you're lucky enough to own a Class A or at least a Class B block of addresses, in which case you might have enough IPs to assign internal and external IP addresses. (Extract from IP subnetting made easy)
  • Looking at a packet traveling over the internet
Windows has a program that lets you trace a packet movement between routers. Type tracert <somehost> in the command prompt. Replace <somehost> with some hosts you want to test.

IP addressing

  • Host IP for various classes of networks Class of networks, first byte in IP address, number of hosts in a network
    • Class A: "0" + 7-bit netid + 24-bit hostid, 1-126, 16M
    • Class B: "10" + 14-bit netid + 16-bit hostid, 128-191, 65536
    • Class C: "110" + 21-bit netid + 8-bit hostid, 192-223, 256
    • Class D: "1110" + 28-bit multicast address, 224-239
    • Class E: "11110" + 27-bit reserved for future use, 240-255
  • 127.x.x.x is local loopback address (for testing)
  • Hostid is all 0's R specify the network
  • Hostid is all 1's R broadcast to all hosts in that network
  • Five classes of IP addresses

Classes

Range of first byte

Format

A

1-126

'0' + 7-bit network id + 24-bit host id

B

128-191

'10' + 14-bit network id + 16-bit host id

C

192-223

'110' + 21-bit network id + 8-bit host id

D

224-239

'1110' + 28-bit multicast address

E

240-255

'1111' + 28-bit address

  • Class Exercises
1. What is the class of the network for each of the following IP addresses?
(a) 12.12.12.12
(b) 125.44.25.223
(c) 220.32.34.125
2. Why there is no network that owns an IP address such as 127.x.x.x?
3. What is the subnet mask for a non-subnetted class C network?
4. Can you send data to 234.5.6.7? If so, what will happen?

IP networks

  • Subnet logically divides a network into small networks
  • The benefits of subnetting
Using the subnet technique, network administrators can divide a network into multiple subnetworks and connect subnetworks with routers.
  • reduces network congestion by redirecting traffic and reducing broadcasts; it can significantly improve the performance of Ethernet network;
  • makes better use of the IP address; and
  • makes it easier to control the network segment by dividing hosts into different subnetworks.
  • A netmask covers the network number portion of the IP address
  • IP datagram = header + PDU (protocol data unit)
  • ARP (Address Resolution Protocol): map IP to Ethernet (hardware) address
  • ICMP (Internet Control Message Protocol): correct IP routing problems
  • Destination unreachable, echo, redirect
  • Learning more:
  • Illustration:

TCP (Transmission Control Protocol)

  • TCP is a connection-oriented protocol: guarantees end-to-end delivery & sequencing
    • Use checksum, acknowledgement, & retransmission
    • Flow control, and slow start algorithm
    • Full-duplex transmission
  • Multiplexing based on port numbers
    • < 1024 for authorized services only (privileged)
    • <= 255 for system use only
  • Socket represents TCP connection between hosts
  • Illustration:

UDP (User Datagram Protocol)

  • UDP is a connectionless protocol: no guarantee
  • Minimize overhead & transmit faster
  • Fragmentation: break a UDP datagram into small packets for transmission (easier to lose)
  • Example: NFS, DNS, SNMP

Class Discussion: When should we use UDP rather than TCP?

IP family of services

FTP (File Transfer Protocol): port 21, 20
Telnet: port 23
Gopher: port 70
Finger: port 79
WAIS (Wide Area Information Server)
NNTP (Network News Transport Protocol): port 119
SMTP (Simple Mail Transfer Protocol): port 25
SNMP (Simple Network management Protocol): port 161, 162
HTTP (Hypertext Transfer Protocol): port 80

Domain Name System

  • DNS: lookup services, or name resolution
    • Translate Internet domain name to IP address
    • E.g. www.ouhk.edu.hk to 202.40.220.3
  • Database maintenance for the mappings
  • Distributed, with a hierarchy of domain name servers
  • Authoritative name servers
  • Caching-only name servers

Firewalls and proxy servers

  • Firewall: examine all traffic to & from a private network for security
    • IP layer packet filtering (e.g. routers)
    • Application level gateway (e.g. proxy servers)
  • Proxy server: intercept requests from clients & reply by itself or forward to real servers
    • Improve access performance
    • Filter requests
    • Hide private network from outside world

Internet Protocol version 6

  • IPv6 = IPng (Internet Protocol Next Generation)
  • Evolutionary upgrade to IPv4
  • 128-bit addressing
  • www.ipv6.org
  • Limitations of IPv4
    • Insufficient addressing space
    • Limited QoS support (bandwidth reservation)

Improvement by IPv6

  • Increase address size from 32 to 128 bits
  • Scope multicast addressing & routing
  • Have anycast addressing (for policy route selection)
  • Reduce extra header fields to improve performance
  • Enable packet labelling to traffic "flow"
  • Support source authentication, integrity and privacy checking
For probing further

Overview of basic concepts for network programming


Extra Materials for probing further

The OSI, or Open System Interconnection, model defines a networking framework for implementing protocols in seven layers. Control is passed from one layer to the next, starting at the application layer in one station, proceeding to the bottom layer, over the channel to the next station and back up the hierarchy.
This article has good explanation on layer services and data encapsulation and good illustration and example about data encapsulation in TCP/IP.
This website has some drawings for you to better understand the structure of the headers for IP, TCP, UDP and ICMP.
IP network engineers need a solid understanding of how IP subnetting works--yet the subject is often taught so poorly, students wind up completely baffled. George Ou has developed a simple, graphical approach that explains IP subnetting in a way that finally makes sense.

Thanks for Reading

If you would rather like to have this lecture note in printed format, please click the print action link in the top right corner.

If you find any problem in this lecture note, please feel free to reach Steven by steven@findaway.hk

Edit - History - Print - Recent Changes - Search
Page last modified on June 17, 2009, at 09:40 PM