Operating System Meets Network
Using a bottom-up approach
Course so far
• Concentrated on standard OS concepts • General OS architecture • Process - threads - micro-kernels • Memory Management
– Algorithms and VM • IO and File Systems
– RAID, Files, Directories
What we left out
• Process and thread synchronization issues • Avoiding deadlock, non-exclusion and
starvation • High level scheduling concepts • Multiprocessor scheduling • Interprocess communication (IPC)
Where is the course going?
You are here!!
Topics we want to cover
• The Effect of Networks on Operating Systems
• Networks – Ethernet, Gigabit Ethernet, WLAN, HIPERLAN
• Network Protocols • Network Processing • Sockets • Socket programming
Course Cont’d
• Client Server Systems - – Remote procedure call (RPC)
• Network Filing System (NFS) • X Windowing System (X) • Virtual Network Computer (VNC) • Web Server Design Issues
– Supporting Apache
Network Evolution
• First use of the Network was to share expensive resources on a Local Area network – e.g. printer, fileserver – For PCs we had Novell Netware, Appletalk – For Unix, IP LAN with postscript printers and
Network File System (NFS)
Network Operating System
• Functions normally provided by an OS now being provided using servers across the network
• Users and applications are unaware of the network
• Host Operating system is changed to be clients of Network Servers
Network Servers
• Servers that are needed to make LANs work • Boot Servers
– provide a way to boot machines over the network
• DHCP Servers – assign IP addresses and give configuration info
• DNS – Resolves names into IP addresses • Gateways - provide access to other LANs
Net-Centric Applications
• Assume network is there and visible to applications and users
• Use the services of LAN servers – DNS, Gateway, etc
• FTP – file Transfer Protocol • Telnet – network Terminal • Email – mh program
Ubiquitous Applications
• Applications’ input and output can be sent over the network
• Applications can run anywhere on the network
• X-Windowing System – Part of Athena Project
• VNC – Virtual Network Computer
Global Servers
• Clients are not on local network • Just be serving files
– FTP server • Execution of code on behalf of the client
– Web Server – PERL scripts or Java code • Increased Network Capacity • Security Concerns
– If you are hacked you will lose money and business big time!
Application Server
• Runs a particular commercial application – Selling cheap airline tickets, or books etc
• Web Server front end • Database back end • Glue in the middle
– Java, CORBA, Perl scripts
• Big site may have 100s or 1000s of Application Servers
Blade Server Technology
• A server is a very thin piece of electronics called a Blade
• Consists of CPU, memory, NIC and some storage (flash or small disk)
• Very densely packed, 100+ in 19 inch rack • Complicated management software • Pioneers – Egenera and RLX Technologies
– IBM, SUN and HP have Blade Server products
GriD Computing
• The Network is the Computer • All processing handled by the network • 1000s of servers available over the globe • Lots of Middleware required • Commercial reality still years away
Implications for Network and Operating Systems
• Network is now centre-stage • Lots of money being poured into getting e-
commerce going • OS needs to efficient, reliable and capable
of handling network demands • More OS functions dedicated to supporting
network related activity – e.g. the sendfile command
LAN Network Technologies
• Ethernet – Dominant around 90% of the market
• Token Ring – Developed by IBM and Madge Networks – Good for Factory Floors
• finite delay before getting the token
• Token Bus – good in theory – Never really made it in practice
Ethernet
• Developed by Xerox Parc • Originally ran at 3 Mbps • 10Mbps -> 100Mbps -> 1Gbps -> 10Gbps • Good wireless support
– 802.11b - 11 Mbps – 802.11a - 55 Mbps
Why has Ethernet been so successful
• Electronics is cheap to build • Moved away from CSMA-CD access
technology to support half-duplex and full duplex switched environments
• Switches not HUBs • Kept the Link Layer the same no matter
which access technology is being used
Why Ethernet has been so successful
• Excellent Standardisation Process – Supported by IEEE, 802.3 standards
• Intel, Xerox and DEC were early adopters and standardized Ethernet systems
• Standards afforded an easy way to upgrade to faster systems
• Also good wireless standards
Ethernet 802.3 Frames
Dst Src Type or Length
Payload F C S
6 6 2 46 - 1500 4
Pre amble
8
Ethernet Addresses
• 48 bits long; Destination and Source • Transmitted with lowest bit first • First two bits significant.
U G
U: 0 = unicast, 1 = multicast G: 0 = global, 1 = local
Type or Length
• If field less than or equal to 1500 then it is treated as a length field
• If the field is greater than 1500 bytes it is treated as a type field
• The Type field is used to indicate different types of payloads
Different Payload Types
PAYLOAD VALUE IN HEX
Loopback 0x0060 Echo 0x0200
IP packet 0x0800
X25 packet 0x0805
ARP packet 0x0806
Appletalk 0x809B IPX 0x8137 IPv6 0x86DD
Different Payload Types
• Provides a good medium to do a number of things
• User Data (IP and IPX) • Diagnostics (DEC protocols) • Network Services (ARP) • Different Networks (Appletalk, X.25, etc)
Ethernet uses different media
• Originally coax cable – awkward for large segments
• Shielded twisted pair – Cat 5 cable – Up to 1000 Mbps
Ethernet Limits 10 –100 Mbits
• Minimum Packet Size 64 bytes = 512 bits • Required for the collision detection stuff to
work • Maximum Packet size = 1518 bytes • Total Ethernet Frame Size = Maximum
Packet Size + Preamble = 1518 + 8 = 1526 bytes
Interframe Gap
• Ethernet must allow a minimum idle period between frames. This is referred to as the Interframe Gap. – No frames are transmitted during this sequence. – Allows the hardware to prepare for the arrival
of the next set of packets.
Interframe Gap cont’d • Minimum Interframe Gap is 96 bit times. So
the actual time is dependent on the the speed of the network
• For 10 Mbps = 9.6 microseconds • For 100 Mbps = 960 nanoseconds • For 1Gbps = 96 nanoseconds • For 10 Gbps = 9.6 nanoseconds
• Some NIC cards use a shorter IFG which can lead to more collisions
Gigabit Ethernet Limits
• Because clock is so much faster: • Minimum packet size 512 bytes = 4096 bits • Packets shorter than 512 bytes have an
extension to make sure they are 512 bytes • Maximum length of 1500 bytes is too small
for stations that want to transmit a lot of data
Burst Extension
• Station does not have to release the carrier after transmitting a packet
• Sender inserts a special sequence in the Gap between frames – Interframe Gap (IFG) sequence but does not drop the carrier
• Sender can transmit a number of Ethernet frames in one burst up to 8192 bytes
Burst Extension
Pre amble
Frame No 1
I F G
Pre amble
Frame No 2
I F G
Pre amble
Frame No 3
Ethernet NICs
• Cost dominated by bus interface and network connectors
• Bus Interfaces: – PCI, EISA, Micro-Channel
• Network Connectors – RJ45, Twisted Pair, Copper and Fibre
IEEE 802.11 Wireless LAN Standards
• Uses CSMA/CA – CSMA:
• The sender listens to the medium before transmitting and defers transmission if the medium is busy
– CA: Collision Avoidance • A station wanting to transmit sends out an RTS frame • If the medium is free, the destination node sends a CTS
response, and then the sender sends the data packet • The sender waits for an ACK packet from the receiver before
discarding the packet
Inter-frame Spaces (IFS) • Short IFS (SIFS)
• used for quick interaction such as RTS and CTS exchanges or sending an ACK
• Point Coordinate IFS (PIFS) • used by the Access Point to the medium ahead of other
stations
• Distributed IFS (DIFS) • time before starting a new transmission
• Extended IFS (EFS) • Used by a station that receives a packet it does not
understand
Backoff
• Stations must backoff from the channel: – If when the station senses the medium before
the transmission of the first packet and the medium is busy (DIFS)
– After each successful transmission – After each retransmission
• Uses Exponential Backoff Algorithm
Synchronization
• Need to keep all mobile stations synchronized to local Access Point (AP)
• AP sends special frames called Beacon Frames
• AP transmits its current clock value in the Beacon Frames
• The MS sets its clock value to the AP’s clock value
Security Issues
• Authentication – Ensuring that only authorized people can join a
particular WLAN • Preventing eavesdropping
– Uses encryption techniques • WEP based on RSA’s RC4 Algorithm • WiFi Protected Access (WPA2) • Security Issues being looked at by 802.11i group
• Traffic Analysis • Active Attacks • Passive Attacks
IEEE 802.11 WLANs • 802.11a
• Operates at 5 GHz • Maximum data rate 54 Mbps • Typical data rate 23 Mbps
• 802.11b • Operates at 2.4 GHz • Maximum data rate 11 Mbps • Typical data rate 4.5 Mbps
• 802.11g • Operates at 2.4 GHz • Maximum data rate 54 Mbps • Typical date rate 23 Mbits
HIPERLAN
• HIPERLAN stands for High Performance Radio Local Area Network
• HIPERLAN was developed by European Telecommunications Standards Institute (ETSI)
• HIPERLAN/2 operates at 5 GHz and offer data rates of 54 Mbps. Similar to 802.11
Key Differences
• 802.11 uses CSMA/CA while HIPERLAN uses TDMA – this is more efficient for audio and video applications
• Typical data flow from HIPERLAN 42 Mbps while from 802.11 a/g 23 Mbits
• HIPERLAN implemented QoS protocols for different sorts of connections. 802.11e developed QoS for 802.11 much later (2005)
Linux Ethernet Device Drivers
• Supports quite a variety • Most can be loaded as modules • Most written by or use drivers written by
Donald Becker – Actually worked for NASA
Ethernet Network Device Structure
• Made up of 2 levels • Lower level
– Interrupt driven – Receive ISR puts packet on General Network
Receive Queue (GNRQ) – Transmit may use several Qs – ISR – short and sweet
Linux Network Driver Structure Lower Level
Device
ISR
Network
Receive Q Transmit Q
Linux Network Processing: Upper Level
• Carried out as part of the tasks of the OS – When the OS is not in interrupt mode
• Receive Packet Processing – Determining packet Type – Process Network Protocol (IP, IPX, X.25) – Process Transport Protocols (TCP, UDP) – Identify socket structure for network
connection
Packet Processing: Upper Level
Type processing
Network Protocols
Transport Protocol Processing
Socket Structure for Connection
Sources for this lecture • Gigabit Ethernet – Rich Seifert – Addison-
Wesley 1998 • TCP/IP and Linux Protocol Implementation
– Jon Crowcroft and Iain Phillips – Wiley 2002