CS197U: A Hands on Introduction to Unix Lecture 9: Network Basics J.D. DeVaughn-Brown University of Massachusetts Amherst Department of Computer Science jddevaughn@cs.umass.edu 1
Last time Subversion control (SVN) svn checkout, add, list svn commit, update, revert, merge More advanced editor Emacs: Crtl+X then S for save, Ctrl+X then C for quit VI: command (normal) mode and insert mode Login command Terminal/process detachment: screen/ nohup, disown Looking for things: find, whereis, which Compare two files: diff cron job setup
Outline Network configuration Your own network interfaces Network background knowledge IP address Network protocol How you are connected to the network Basic network debugging Tracking a remote site
Your network configuration as root Network Interface = network card A lot of networking config utilities start with if ifconfig - print or adjust network interface settings eth0 = primary/default Ethernet network interface wlan0 = wireless networking interface lo = loopback (this machine) - used for debug ifup / ifdown INTERFACE = connect/ disconnect a network card Short for ifconfig <INTERFACE> up/ ifconfig <INTERFACE> down Be careful if you are logged in remotely! Can monitor network statistics: cat /proc/net/dev 4
Your network configuration - ifconfig Ethernet Interface Local host Wireless Interface IP address MAC address
Your wireless network GUI Mode: network manager /etc/init.d/network- manager start/stop/restart Command mode activate your wireless interface ifconfig wlan0 up scan for available ESSIDs/APs iwlist wlan0 scan associate your wireless interface to an AP named CSnet iwconfig wlan0 essid CSnet key s:<password> acquire an IP address from the AP/DHCP server dhclient wlan0 (Dynamic Host Configuration Protocol Client) Now you know more about your devices, but HOW are you connected to the Internet?
Outline Network configuration Your own network interfaces Network background knowledge Network protocol IP address How you are connected to the network Basic network debugging Tracking a remote site
What s the Internet: nuts and bolts view PC server wireless laptop millions of connected computing devices: hosts = end systems cellular running network apps handheld coffee machine? access points wired links communication links fiber, copper, radio, satellite transmission rate = bandwidth Mobile network Global Home network Regional Institutional network router routers: forward packets (chunks of data)
What s the Internet: nuts and bolts view protocols control sending, receiving of msgs e.g., TCP, IP, HTTP, Skype, Ethernet Mobile network Global Internet: network of networks loosely hierarchical public Internet versus private intranet Internet standards RFC: Request for comments IETF: Internet Engineering Task Force Home network Regional Institutional network
What s a protocol? human protocols: what s the time? I have a question introductions specific msgs sent specific actions taken when msgs received, or other events network protocols: machines rather than humans all communication activity in Internet governed by protocols protocols define format, order of msgs sent and received among network entities, and actions taken on msg transmission, receipt
What s a protocol? a human protocol and a computer network protocol: Hi Hi Got the time? 2:00 time TCP connection request TCP connection response Get www-edlab.cs.umass.edu/cs197u/index.html <file> Q: Other human protocols?
The network edge: end systems (hosts): run application programs e.g. Web, email at edge of network KaZaA Napster client/server model client host requests, receives service from always-on server e.g. Web browser/server; email client/server peer-peer model: minimal (or no) use of dedicated servers e.g. Skype, BitTorrent peer-peer client/server
Access net: home network wireless devices often combined in single box to/from headend or central office cable or DSL modem wireless access point (54 Mbps) router, firewall, NAT wired Ethernet (100 Mbps)
Local area networks (LANs) institutional link to (Internet) institutional router Ethernet switch institutional mail, web servers typically used in companies, universities, etc 10 Mbps, 100Mbps, 1Gbps, 10Gbps transmission rates today, end systems typically connect into Ethernet switch
Wireless access networks (WANs) shared wireless access network connects end system to router via base station aka access point wireless LANs: within building (100 ft) 802.11b/g (WiFi): 11, 54 Mbps transmission rate wide-area wireless access provided by telco (cellular) operator, 10 s km between 1 and 10 Mbps 3G, 4G: LTE to Internet to Internet
Internet structure: network of networks roughly hierarchical at center: tier-1 s (e.g., Verizon, Sprint, AT&T, Cable and Wireless), national/international coverage treat each other as equals Tier-1 providers interconnect (peer) privately Tier 1 Tier 1 Tier 1
Tier-1 : e.g., Sprint POP: point-of-presence to/from backbone. peering to/from customers
Internet structure: network of networks Tier-2 s: smaller (often regional) s Connect to one or more tier-1 s, possibly other tier-2 s Tier-2 pays tier-1 for connectivity to rest of Internet tier-2 is customer of tier-1 provider Tier-2 Tier-2 Tier 1 Tier 1 Tier 1 Tier-2 Tier-2 Tier-2 s also peer privately with each other. Tier-2
Internet structure: network of networks Tier-3 s and s last hop ( access ) network (closest to end systems) Local and tier- 3 s are customers of higher tier s connecting them to rest of Internet Tier 3 Tier-2 Tier 1 Tier-2 Tier 1 Tier-2 Tier 1 Tier-2 Tier-2
Internet structure: network of networks a packet passes through many networks! Tier 3 Tier-2 Tier 1 Tier-2 Tier 1 Tier-2 Tier 1 Tier-2 Tier-2
IP addressing IP address: 32-bit identifier for host, router interface 223.1.1.1 223.1.2.1 interface: connection between host/router and physical link router s typically have multiple interfaces host typically has one or two interfaces (e.g., wired Ethernet, wireless 802.11) IP addresses associated with each interface 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.3.27 223.1.3.1 223.1.2.2 223.1.3.2 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1
IP addresses: how to get one? Q: How does host get IP address? Static: hard-coded by system admin in a file Edit file: /etc/network/interfaces (other Linux dist.: /etc/rc.config) Dynamic: Dynamic Host Configuration Protocol (DHCP) host broadcasts DHCP discover msg DHCP server responds with DHCP offer msg host requests IP address: DHCP request msg DHCP server sends address: DHCP ack msg Usually in the form of 192.168.x.x Command: dhclient <interface> Why do we need DHCP?
Tracking a remote site: Demo ping: test if a remote host is reachable and measure packet round trip time host: convert host names to IP addresses and vice versa traceroute: display the path and measure the transit delay of packets 3 round trip time measurements for each hop You might need to install traceroute as a sudoer Will need this for your assignment-6
Summary Command Description ifconfig/if up/if down Information about interfaces iwconfig/iwlist Wireless connection/association dhclient Getting an IP address from DHCP server ping Checking out a remote host host Resolve the name/ip address of a site traceroute Tracking a packet s end-to-end path/delay 24