420 likes | 575 Views
LSVE: A Network Primer. Manuel Oliveira Computer Science Department University College London. Audience Assessment. Know about networks? Know what TCP, UDP, multicast is? Know how a router works inside? Know about multicast routing algorithms?. Contents. Motivation
E N D
LSVE: A Network Primer Manuel Oliveira Computer Science Department University College London
Audience Assessment • Know about networks? • Know what TCP, UDP, multicast is? • Know how a router works inside? • Know about multicast routing algorithms?
Contents • Motivation • How to Talk to Network People? • Network Elements • Network Properties • Protocols • Multicast • How to Access the Network • Discussion
Motivation: Applications • Remote Training • Combat Simulation • Games • Education • Visualization • Collaboration • Socialization
Motivation: Evolution MATRIX VE Presence Online Games Graphical MUDs MUDs Evolution
Motivation: Games Perspective • Humans are Social Beings • Collaboration • Share Experiences • UO most popular activity? • Competition • Online categories: achievers, explorers, socializers and killers • A Human is better than AI/AL
Motivation: Games Better than VE? Games VE* Big budgets 2-3 years cycle Content driven Entertainment Robust Cool graphics Network is not cool Budget? PhD, masters or undergraduate Functionality driven Test research ideas Hacks Cool slow graphics Network less bad * DIS systems are an exception
How to Talk to Network People: OSI Model Host A Host B protocol Layer n+1 Layer n+1 API Layer n Layer n Network
How to Talk to Network People: OSI Model Data Host A Layer n+1 PDU n+1 Data Layer n PDU n PDU n+1 Data
How to Talk to Network People: OSI How to Talk to Network People: OSI Model Application Presentation Session Transport Network Data Link Physical
How to Talk to Network People: OSI How to Talk to Network People: OSI Model Application Application Presentation Presentation Session Session Transport Transport Network Network Data Link Data Link Physical Physical
How to Talk to Network People: OSI vs IP Application Application Presentation Session Transport Transport OS Network Internet Protocol Data Link Data Link Physical
How to Talk to Network People: IP Application FTP SMTP DNS SNMP TCP UDP Transport ICMP Internet Protocol IP IGMP Data Link ARP/RARP SNAP Ethernet, FDDI
Network Elements: Overview • Address • Host • User’s computer has unique IP address • Router • Routes the data packets across the network • Queues per link for incoming packets • Lookup table • Gateway • Router that does protocol conversion
Network Elements: Address + Port • Class A (network ID = 7 bits) • Class B (network ID = 14 bits) • Class C (network ID = 21 bits) • Class D (multicast) • Class E (reserved for future use) 0 Network ID Host ID 1 0 Network ID Host ID 1 1 0 Network ID Host ID 1 1 1 0 Multicast group 1 1 1 1 0 reserved
Network Elements: IP Packet Version Hdr len Type Of Service Packet Len Identification Flags Fragment Offset 20 bytes TTL Protocol ID Hdr Cheksum Source address Destination address Options (if any) Data
Network Elements: IP Routing Admin commands UDP TCP Other y n Local? ICMP redirects routing Options Next Hop? Routing Table src routing Queue Network Interface
Network Properties • Latency (Round Trip Time) • Jitter • Bandwidth (Capacity) • Loss (Congestion, Reliability)
Protocols Transport Level: • User Datagram Protocol (UDP) • Transport Control Protocol (TCP) • Application • Real Time Protocol (RTP) • Network Time Protocol (NTP) • File Transfer Protocol (FTP) • Domain Name Service (DNS)
Protocols: UDP • Connectionless • No state is maintained • No setup time • Light-weight • No Quality of Service • No guarantee delivery • No order delivery Postal Service
Protocols: UDP packet Source Port Destination Port 8 bytes Length Hdr Cheksum Data
Protocols: TCP • Connection Oriented • State is maintained at routers • Setup Handshake • Heavy-weight • Quality of Service • FIFO delivery • Flow Control • Error Recovery • Mechanisms • Sliding Window, Timers, Acknowledgements Telephone Service
Timer Packet N Ack N Protocols: TCP Peek under the Hood Host A Host B
Timer Timer Packet N Packet N Ack N Protocols: TCP Peek under the Hood Host A Host B
Protocols: TCP packet Source port Destination port Sequence number 20 bytes Ack number Hdr len Options Flags Window size Checksum Urgent Pointer Options (if any) Data
Broadcast WAN WAN Multicast WAN Unicast Multicast: Overview
Multicast: Model • UDP class D address – No physical meaning • Multicast is free on LANs • An address defines a logical group • A sender is oblivious to receivers • Join/Leave operations • Tree Based Routing
Multicast: Routing Overview Multicast Routing Protocol Internet Group Management Protocol (IGMP)
Multicast: Routing • Three types: • Flood/Prune (or Reverse Path Multicast) – basis for MBone • Steiner - never implemented, just simulated • Centred Based – begins to be deployed • Some Protocols: • Distance Vector Router Multicast Protocol (DVRMP) • Multicast Open Shortest Path First (MOSPF) – based on link info • Core Based Trees (CBT) • Protocol Independent Multicast (PIM) • Sparse Mode (SM), Dense Mode (DM)
join join join Multicast: Core Based Trees CBT IGMP
join-ack join-ack join join Multicast: Core Based Trees CBT IGMP
join-ack Multicast: Core Based Trees CBT IGMP
Multicast: Core Based Trees CBT IGMP
Multicast: Problems • Deployment problems • mainly interdomain routing • No pricing model • Membership Authorisation • Security • Address Allocation: • Scope • Clashes • Announce/Listen (sdr) • TCP-Friendliness (congestion) • Error Recovery is a nightmare
Multicast: Temporary Solution • Single Source Multicast (SSM) • IGMPv3 – who to listen to • Multicast Source Discovery Protocol (MSDP) – RP exchange • Multicast Address Dynamic Client Allocation Protocol (MADCAP) – Multicast DHCP
Protocol 0 = default Protocol Family Socket Type How to Access Network: C • Creating a Socket int sock; if ((sock = socket (PF_INET, SOCK_STREAM, 0))<0) { do error handling return }
How to Access Network: C • TCP - Server struct sockaddr_in auxAddr; bzero((char *)&auxAddr, sizeof(auxAddr)); auxAddr.sin_family = PF_INET; auxAddr.sin_addr.s_addr = htonl(INADDR_ANY); auxAddr.sin_port = htons(800); If (bind(sock, (struct sockaddr *)&auxAddr, sizeof(auxAddr)) == -1) { do error handling return; }
How to Access Network: C • TCP - Server struct sockaddr_in clientAddr; int clientSock; listen(sock, 20); while (clientSock = accept(sock, (struct sockaddr *)& clientAddr, sizeof(clientAddr)) != -1) { process the clientSock, use threads! } do error handling
How to Access Network: C • TCP – Client struct sockaddr_in auxAddr; bzero((char *)&auxAddr, sizeof(auxAddr)); auxAddr.sin_family = PF_INET; auxAddr.sin_addr.s_addr = inet_addr(“137.158.128.5”); auxAddr.sin_port = htons(800); if (connect(sock, (struct sockaddr *)&auxAddr, sizeof(auxAddr)) == -1) { do error handling }
How to Access Network: C • TCP – Client • int write(int /*socket*/, byte * /*data*/, int /*data len*/) • int read(int /*socket*/, byte * /*buffer*/, int /*max to read*/)