Asante 10Base2 User Manual

Browse online or download User Manual for Networking Asante 10Base2. Networking, USB, and Threads - CSEE W4840 [en]

  • Download
  • Add to my manuals
  • Print

Summary of Contents

Page 1 - Networking, USB, and Threads

Networking, USB, and ThreadsCSEE W4840Prof. Stephen A. EdwardsColumbia UniversityFall 2015

Page 2 - POSIX Threads (pthreads)

Ethernet (MAC) addresses48 bits ≈ 281 trillion (world population: 6.5 billion)Bits 48–24: Vendor codeBit 41: 0=ordinary, 1=group (broadcast) addressBi

Page 3

An Ethernet Packet00d006269c00 Destination MAC address (router)00087423ccab Source MAC address (my desktop)0800 Type = IP packet45 IPv4, 5 word (20-by

Page 4 - Ethernet

IP Header31 28 27 24 23 16 15 13 12 0Version Words in Type of Service Total number of bytes= 4 Header (typically 0) in the IP packetIdentification Numb

Page 5 - 10Base-5 “Thicknet”

IP Addresses32 bits ≈ 4 billion (world population: 6.5 billion)First n bits indicate network (n = 8, 16, 24)For example, columbia.eduowns 128.59.0.0 –

Page 7 - 10Base-T and 100Base-T

Sockets// Create an Internet socket (SOCK_STREAM = TCP)int sockfd = socket(AF_INET, SOCK_STREAM, 0);// Connect to the server#define IPADDR(a,b,c,d) (h

Page 8 - 100Base-TX wiring (CAT 5)

USB: The Universal SerialBus

Page 9 - An Ethernet Frame

USB: Universal Serial Bus1.5 Mbps, 12 Mbps, 480 Mbps (USB 2.0), 5 Gbps (USB 3.0)Point-to-point, differential, twisted pair3–5m maximum cable length

Page 11 - An Ethernet Packet

USB signalingNRZI: 0 = toggle, 1 = no changeBit stuffing: 0 automatically inserted after six consecutive 1sEach packet prefixed by a SYNC field: 3 0s fol

Page 12 - IP Header

Ethernet and the InternetSocketsUSB: The Universal Serial Buslibusb 1.0POSIX Threads (pthreads)

Page 13 - IP Addresses

USB PacketsAlways start with SYNCThen 4-bit type, 4-bit type complemented2 bits distinguish Token, Data, Handshake, and Special,other two bits select

Page 14

USB Bus ProtocolPolled bus: host initiates all transfers.Most transactions involve three packets:I“Token” packet from host requesting dataIData packet

Page 15

USB Data Flow TypesIControlFor configuration, etc.IBulk DataArbitrary data stream: burstyIInterrupt DataTimely, reliable delivery of data. Usually even

Page 17 - USB: Universal Serial Bus

USB Physical Bus TopologySource: http://www.usblyzer.com/usb-topology.htm

Page 18 - USB Connectors

lsusb outputFront: USB keyboardBack: IR receiverBack: Monitor w/ webcam, microphone (internal hub)Back: 7-port hub w/SD card readerBluetooth dongleSoC

Page 19 - USB signaling

lsusb -t outputFront: USB keyboardBack: IR receiverBack: Monitor w/ webcam, microphone (internal hub)Back: 7-port hub w/SD card readerBluetooth dongle

Page 20 - USB Packets

Devices, Configurations, Interfaces, and EndpointsDevices (Keyboards, Mice: physical object)Configurations (usually one)Interfaces (“logical device”: us

Page 21 - USB Bus Protocol

USB Addresses and EndpointsSource: http://www.beyondlogic.org/usbnutshell/usb3.shtml

Page 22 - USB Data Flow Types

USB Keyboard: lsusb (highlights)Bus 002 Device 007: ID 413c:2003 Dell Computer Corp. KeyboardDevice Descriptor:bDeviceClass 0 (Defined at Interface le

Page 23 - Layered Architecture

Ethernet and the Internet

Page 24 - USB Physical Bus Topology

USB SD Card Reader: lsusb (highlights)Bus 001 Device 006: ID 0bda:0119 Realtek Semiconductor Corp. Storage Device (SD card reader)Device Descriptor:bD

Page 25

libusb 1.0

Page 26

Libusb 1.0User-level C library for USB device access. lsusb built on it.www.libusb.org1.0 API supplants earlier libusb 0.1Nice tutorial: http://www.dr

Page 27 - Configurations (usually one)

Using libusb1. Initialize the library with libusb_init()2. Select your device from the list returned bylibusb_get_device_list(). Later, free the list

Page 28 - USB Addresses and Endpoints

libusb: Finding a Keyboardlibusb_device**devs;struct libusb_device_descriptor desc;struct libusb_device_handle*keyboard = NULL;ssize_t num_devs, d; ui

Page 29

libusb: Reading from a Keyboard#define USB_LCTRL (1 << 0)#define USB_LSHIFT (1 << 1)#define USB_LALT (1 << 2)#define USB_LGUI (1 <

Page 30

USB HID Keyboard Protocol PacketPage 60 of http://www.usb.org/developers/devclass_docs/HID1_11.pdfByte Meaning0 Modifier keys1 Reserved2 Keycode 1...7

Page 31

USB HID KeycodesPage 53: http://www.usb.org/developers/devclass_docs/Hut1_12v2.pdfCode Meaning0 No event...4 a or A5 b or B...29 z or Z30 1 or !...38

Page 32 - Libusb 1.0

POSIX Threads (pthreads)

Page 33 - Using libusb

Creation and Termination#include <stdio.h>#include <pthread.h>void*mythread(void*ptr){printf("%s\n", (char*)ptr);return NULL;}in

Page 34

EthernetStarted in about 1976 at Xerox PARCIEEE Standard 802.3Carrier-sense multiple access/carrier detect protocol:1. Listen to the cable2. If nobody

Page 35

Mutexes#include <stdio.h>#include <pthread.h>pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;int counter = 0; /*Caution: shared variabl

Page 36

Condition Variablespthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;pthread_cond_t cond1 = PTHREAD_COND_INITIALIZER;int count; int valid = 0;void*wr

Page 37 - USB HID Keycodes

10Base-5 “Thicknet”Shared coax bus with “vampire tap” tranceiversYellow color suggested by the 802.3 standardFrom http://www.turkcenet.org/yerel_htm/1

Page 38

10Base-2 “Thinnet”50-Ohm coax segments with BNC “T” connectorsCoax invariably blackFrom http://www.answers.com/topic/10base2

Page 39 - Creation and Termination

10Base-T and 100Base-TPut the shared medium in a hub: a star topology. Everybodyuses it now.Star topology Choice of colorsFrom http://www.asante.com/d

Page 40

100Base-TX wiring (CAT 5)Pair of twisted pairs, one pair for each direction.Hub-to-computer cable is straight-through.Computer-to-computer cable is a

Page 41 - Condition Variables

An Ethernet Frame7 bytes 1 6 6 2 46–1500 4Preamble SOF Dest. Src. Type Payload ChecksumSOF Start of FrameDest. Destination addressSrc. Source addressT

Comments to this Manuals

No comments