COMS 1001 Introduction to Computers Networking
What's Ahead Networking layers Network Speeds Protocols, sockets, client/server Routing, DNS, Ethernet, LANs, wireless
What is a Network? Loose definition: a series of interconnected nodes Computer networks are systems where computers (CPUs, memory) are the nodes Building a reliable computer communications network requires employing interfaces and abstraction Primary function of computer networks is to push bits around. Collections of bits are called packets. Packets are the logical network primitive.
The Network as a Graph In CS, graphs are an especially useful data structure for modeling, analyzing, examining, and testing networks, network algorithms, and network protocols. The set of edges correspond to links between the nodes, and the nodes are known as clients, servers, or peers, depending on their interaction.
Composition of a Network Layering and abstraction enable the network to be split into logical and physical components For example, the physical links (wire) can be telephone/copper wire, fiber optic cable, Ethernet cabling, wireless radio signals, etc Many different logical frameworks can be implemented on top of this variety of physical mediums
The OSI Network Model The standard networking model: Open Systems Interconnection Model 7 stacked layers Not all are used in real life Directly reflected in an operating system's network stack Each layer understands more complex information than the layer beneath, but is independent of the layer beneath or above
OSI Stack (cont.) Application: information specific to software applications Presentation: pretty formatting for application information Session: high level semantic application use Transport Network Data link Physical
OSI Stack (cont.) Way too many levels for efficient implementation Application, presentation, and session tend to get jammed together, and since they are application dependent, simply act as payload or opaque data for the lower levels Physical layer is about converting electronic signals to bits, etc Network, Link, and Transport layers are the most interesting
How Does Layering Work? Information is passed around in packets Each packet has a header and a payload The header contains control information, such as the length of the payload The payload often contains the information for another layer, and another layer inside that payload, etc., like the skins of an onion The operating system contains a piece of code that allows data to move up and down the network stack
The OS Network Stack Application gets a piece of data, needs to send it over the network The stack takes the data and wraps it from the top (TCP) with the appropriate header, then passes it to the layer beneath (IP) Data packet proceeds down the stack until it is ready to be sent out via the network card The destination machine's network card receives the packet and proceeds to send it up its network stack
Layering: The Ship, The Box, and the Envelope Consider: you want to send a letter to your friend in the E.U. Write the letter (data/bits/payload) and enclose it in an envelope (first layer). You address the envelope (header data). You give the letter to the mailman. The post office puts it in a cargo box with some of their official labeling. (Another layer and header) The box is loaded onto a ship and sails from here to Europe. (another layer and header)
Real Life Layers Link layer Network layer Transport Layer Application/Presentati on Layer Ethernet IP (Internet Protocol) TCP or UDP HTTP
TCP vs. UDP Transmission Control Protocol Structured, connection, streaming Reliable User Datagram Protocol Connectionless Out of order, lost, and duplicate delivery Fast
Addressing How to find the node you're looking for Ethernet, for example, provides a MAC address, a number burned into the hardware IP provides IP addresses (you may have heard of these) IP Address names a machine location, and the IP layer (network layer) provides the IP address and a destination port number (which specific OS process to deliver the information to on that machine)
Naming IP Addresses are 32 bit numbers (in Ipv4) Often written like: 128.59.16.9 But who wants to remember numbers? DNS (or Domain Name Service) allows a name to be associated with the address (like www.google.com) Humans can then use the friendly name and have the address translated automatically by having the OS contact a DNS server
Ethernet & LAN A LAN is a local area network and is a layer 2 (link layer) concept Many LANs use Ethernet Nodes are all peers, and the LAN is a broadcast medium (everyone receives every packet on the wire) The network card does the OS a favor by discarding the packets that are not destined for the IP address of the machine Most common piece of LAN equipment is a hub or bridge: rebroadcasts on each port
Network Speeds What are those people selling? Dialup phone modem: 28,44,56kbs ISDN 56/128 kbs dual channel ADSL 7.1 mbps down, 1.1 up 1.5 mbps (SDSL) Cable Modem: 27 Mbps, 2.5 Mbps (asym) 256kbps Ethernet: 10/100Mbs, Wireless: 11Mbs (often get 8) T1,T3 (1.5 Mbps, 44.7 Mbs)
IP Address 32 bit quantity that maps to a network card in a computer (computers can have multiple network cards and multiple IP Addresses) Network and host part 192.168.xxx.yyy are private ip addresses Network part is 192.168.0.0 Host part is xxx.yyy A network prefix determines how many bits belong to the network part
IP (Internet Protocol) IP is a connectionless network service that can route packets between a source and a destination IP depends on IP addresses IP needs to know next hop on the path to the ultimate destination This is what Routing is all about, and what a router does. It's impossible for any single machine to store all paths between every machine on the network (the whole Graph of the Internet)
Network Tools Ping Traceroute netstat tcpdump
Ports and Services Ports are numbered and many are wellknown or reserved. For example, web servers run on port 80. Mail servers run on port 25 SSH servers run on port 22. FTP runs on port 21 Ports range from 0 to 65535 IPAddresses:Postal Address :: Ports:apt number