Dr. Greg Bernstein
Updated March 18th, 2021
You need to understand networking for?
Front End Development
Back End Development
Front and Back End Development
Only as a specialist
To create and run webservers we need to know about:
Need a bit of understanding of what it is built on and why
How much cable do we need to communicate?
A lot
A moderate amount
Depends on cost and capacity
That’s a question for a different course
We have N computers that wish to communicate:
How many one directional channels do we need for them to communicate?
We need N(N-1) one directional channels!
What do we need to share channels?
Encryption
Ports
Addresses
A way to identify different blocks of info
Need a way to identify which information is intended for which recipient?
Many methods exist: time division multiplexing, wavelength division multiplexing, etc.
We will only be concerned with packet switching
Which is older packet switching, e.g., internet, or circuit switching (old telephone network)?
Packet Switching
Circuit Switching
It depends what you mean by Packet Switching
How Should I know
The concepts behind packet switching are widely applicable:
A container “switch”, and container “link”
Are you currently using Ethernet?
Right now
At Home
I never touch the stuff
How Should I know
From IEEE 802.3 Standard:
Unique address given to every ethernet end system. Known as MAC addresses. These are allocated in blocks to device manufacturers by the IEEE.
These are more like unique identifiers than what we might think of as “addresses”.
From Wikipedia MAC addresses:
Multiple switch wired Ethernet network:
Ethernet Switches construct a table to tell them on which port to send a packet with a given destination address.
Every destination on the Ethernet network needs a table entry and there is no way to summarize the information since Ethernet addresses are given out based on manufacturers and not “network location”.
Ethernet by itself cannot scale to create a world wide Internet ==> this is why we have the Internet Protocol (IP)
Does your cell phone use IP?
Only when I’m talking
Only when I’m surfing the web
Depends on the app
How should I know
There are two flavors of the Internet Protocol: IPv4 and IPv6
IPv6 is the newer version, however IPv4 is still widely used and simpler to understand at first.
We will only talk about and use IPv4 in this class.
Diagram from the Internet
The Destination Address
But Who at the destination? This is what the protocol field in the header is for.
Large list at Wikipedia: IP Protocol Numbers
Transmission Control Protocol (TCP) Hex 0x06, Decimal 6
User Datagram Protocol (UDP) Hex 0x11, Decimal 17
Your computers Ethernet adapter comes with a manufacturer assigned Ethernet address
Your computer does not come with an IP address for networking purposes, but is given one by the network.
There are different types of IP addresses for different contexts.
See Wikipedia: IPv4
Public IP Addresses: Your ISP would give one to your entire house or apartment.
Private IP Addresses: You get one of these from your home router or from the campus network.
Loopback (Machine Local) Addresses: Used within a machine, the range of addresses you can use is 127.0.0.0–127.255.255.255, i.e., over 16 million addresses. We will use these during webserver development.
Unique addresses assigned in a hierarchical manner starting with IANA, then allocated to regional authorities, down to ISPs.
Hierarchical, location based allocation of addresses allows for “summary routing”, that is routing based on only part of the IP address.
This drastically reduces the size of the forwarding table in IP based packet switches (known as “routers”, but this term is over used.)
Figure from IANA (Internet Assign Number Authority)
The transport layer provides extra functionality over the network layer
TCP and UDP both provide multiplexing via source and destination port numbers. This allows multiple “conversations” between the same pair of IP addresses.
TCP also provides for reliable delivery of byte streams. This greatly increases its complexity over UDP.
User Datagram Protocol (UDP) packet header
Under which situation must we use both source and destination UDP/TCP ports?
Always, can’t tell packets apart otherwise
When two different computers talk to a process on a computer listening on a specific destination port
When two different processes on the same computer need to talk to a process on another computer listening on a specific destination port
Never, ports are over rated
Image sizes can be much greater than the MTU. How can you send it?
Don’t, images are not necessary
Just send as much as will fit in the MTU
Break it into smaller pieces for transmission and reassemble at the other side
Only use text
If you chose to break your image into smaller pieces, how should you handle a “lost” piece?
Not worry about it
Send every piece twice to make sure it gets there
Give each piece a number and have the receiver acknowledge that it got the piece
Errors never occur in packet networks since they are digital
Transport Control Protocol (TCP) packet header
These are where servers/services listen, i.e., destination ports
These are where servers/services listen, i.e., destination ports
When we work with multiple servers on our own machine we need to make sure the ports don’t collide
Development servers frequently use non-standard ports
Other types of services such as database servers, Redis, etc… will be accessed via non-standard ports.
The Domain Name System (DNS) is used to resolve domain names into IP addresses.
From Wikipedia DNS: The Domain Name System (DNS) is a hierarchical decentralized naming system for computers, services, or other resources connected to the Internet or a private network.
Buyer Beware!
I can get a domain for CS3520 or any other class!