Some Networking concepts
Internet of Things (IoT) 3 tier architecture
- Sensing – comprises objects that generate data
- Networking and Data Communications
- Applications – data processing
Computing devices and computer networks
- Computing devices – programmable, multiuse machines that accept data
- Computer networks – electromagnetic devices and systems for communicating over long distances
Data vs Information
- Data – raw facts and figures that can be processed into information.
- Information – a data that has been summarized for use in decision making.
Binary numbering system - 2 digits (0,1)
e.g. 1001 = 2^31 + 2^20 + 2^10 + 2^01 = 8+1 = 9
Octal numbering system – 8 digits (0-7)
Hexadecimal numbering system – 16 digits (0-9,A-F)
Transducers (e.g. Microphone)
- Device that convert signal from sound wave/light intensity/temperature to another,
which is electrical signal. - Signal outputted from transducers are usually in analog form.
Analog signals
- Continuous signals varying over time.
Digital signals - A sequence of discrete values (amplitude) that is sampled and quantified from a
physical signal.
Digitalization
- Sampling
- Reducing a continuous-time signal to a discrete-time signal
- Nyquist sampling theorem
- Quantization
- Mapping the set of sampled values
- Quantization error
- The difference between the original signal and the reconstructed signal.
- Maximum quantization error = 1⁄2 the height of a quantization level
Bits and bytes
ASCII-8 (8 bit American Standard Code for Information Interchange)
EBCDIC ( Extended Binary Coded Decimal Interchange Code)
Color depth
- Controls the total number of color that can be displayed
- 1 bit / pixel – Binary Images (black and white)
- 8 bits / pixel – Greyscale (256 levels of grey) / 8bit color (256 colors, 3R3G2B)
- 24 bits / pixel – True Color (8R8G8B)
Digital video
- A sequence of digitized pictures
- Frame rates (fps)
- Full-motion video: 24-30 f/s, 60 f/s for HDTV * Animation: 15-19 f/s
- Video telephony: 5-10 f/s
Size of image = Resolution x color depth
Time to transmit = size/speed (care unit)!
Data rate of a video = Resolution x Color depth x Frame rate
Central Processing Units (CPUs) can only understand 1 and 0s
Assembly language programming
- Assembly language is created to help human instructing a CPU to work
- Assembler convert assembly language program into machine language program
- Different from human used languages
- More efficient code than high level language
- Apply for embedded systems (e.g. washing machines)
High level language programming
- Least amount of effort to write a program
- May not be optimal
- Apply for large scale programs
System Software vs Application Software
- System Software
- Programs controlling the actual operations of computer equipment
- Application Software
- Programs performing specific tasks
Single-tasking and multi-tasking operating systems
- Single-tasking
- the processor will execute its assigned tasks one by one.
- Multi-tasking
- Processor will be shared by different tasks.
Driver and Drive
- Driver
- A program that tells an operating system how to communicate with a hardware component
- Drive
- A storage device
CPU
- Performs the actual processing of data
- Communicate with input, output and storage devices
- Carry out instructions given by user
- Normally packed in an integrated circuit (IC) chip
Single-core and multi-core central processing units
- Single-core CPU
- Execute single task at a time
- Multi-core CPU
- Execute multiple tasks simultaneously (better at divided tasks)
Performance of a CPU
- Clock speed (measured in GHz)
- GHz higher = higher performance
- Cores
- More core = higher performance
Storages
Primary Storage
- Registers
- Requires continuous supply of electricity (volatile)
- Small amount of very fast memory blocks located inside CPU chip
- Cache Memory
- Volatile
- A special group of fast memory circuitry close to the CPU
- Speed up processing by temporarily storing data and instructions
- Random Access Memory (R.A.M.) – provides temporary storage
- Volatile
- Stores commands / data from input devices
- Stores currently running programs/ their data
- Stores intermediate data generated by the currently running programs
Secondary Storage
- External Memory (hard drives, optical discs, flash drives)
- Non-volatile
- Stores programs/data for future/long-term use
- Keeps programs and data when primary is full
Primary storage can only store data temporarily Comparatively, the capacity of the primary storage is limited
Primary Storage vs Secondary Storage Small capacity vs large capacity Volatile vs non-volatile
High speed vs low speed
High cost vs low cost
OSI Model – Open Systems Interconnection
- Basis for the creation of protocols
- Each interface defines what information and services a layer must provide for the layers above and below it
7 Layers of OSI Model
- Physical Layer
- Data Link Layer
- Network Layer
- Transport Layer
- Session Layer
- Presentation Layer
- Application Layer
1.Physical Layer
- Responsible for Transmitting bits
- Responsible for physical connection
Topology
- Bus Topology (old type)
- Mesh Topology (each has one link to each)
- Star Topology (ethernet switch or router)
Information Unit
- Smallest unit of information - frame
2.Data Link Layer (MAC address, Token Ring)
- Provide error-free frame transfer by acknowledgment and retransmission
- Transform physical layer to a reliable link by providing error-checking services
- Node-to-node delivery of reliable data
Identification of Network Node
- Ethernet Address (48-bits) long, divided into two parts
- Organizationally Unique Identifier (OUI)
- Broadcast Address (48-bits) long, used for sending a frame to ALL stations on LAN
- Each F equals 4 bits
Frame Format (IEEE 802.3)
- Preamble (7 bytes) – for alternating 1’s and 0’s
- SFD (1 bytes) – start frame delimiter
- Des.Add - destination
- Sour.Add - source
- FCS (4 bytes) – Frame Check Sequence for error detection
Frame effiency = Data / (All + FCS + Data)
3.Network Layer(IP)
- Responsible for the end-to-end (source-to-destination) delivery of a packet across multiple networks
- Logical address: IP address (158.132.xxx.xxx)
- Physical address: Ethernet address (FF:FF:FF:FF:FF:FF)
Information unit – datagram/packet
IP address (32 bit long)
Class A – for large organizations, supports 24bits host
- Net I.D. started with a ‘0’, runs from 1 to 2^7-2
- There can be 2^24-2 hosts or computers
- Starts from 0
Class B – support 16 bits host - For medium-size networks
- 2^(16-2) -2 networks
- Starts from 10
Class C – support 8 bits host - For small networks
- 2^(24-3) -2 networks
- Starts from 110
Class D – for multicast gps
- Not often supported on Internet
- Each address is used to define a group of hosts on the internet
- Starts from 1110
Class E – future use
4.Transport Layer (TCP)
- Responsible for process-to-process delivery of the entire message
- Segmentation (a message -> segments) and Reassembly (segments -> a message)
Port Numbers
- Header of TCP segment contains 16 bit source port no. and 16 bit des port no.
- HTTP server : Port 80
- 3 Types of port numbers
- Well-known ports: 0 to 1023
- Registered ports: 1024 to 49151
- Dynamic ports: 49152 to 65535 (Temporary)
Socket = IP address(only points to computer) + TCP port number(port to application)
5.Session Layer (Winsock, UNIX Socket)
- Responsible for the establishment, maintenance and release of session
- Provide synchronization between user tasks (alternating 0s and 1s)
- Dialog controller
Unit of Information: message/data
Session
- Share same ip, mac address, port number
- May give other port number but belong to the same system.
6.Presentation Layer (redirector, SSL)
- Translate data to suitable format (e.g. encryption/decryption)
7.Application Layer (FTP, Telnet, HTTP)
- Entry point for application programs/users to access network
- Supports user application directly
File Transfer
- Implemented by FTP
Review (PDNTSPA)
Physical Layer – physical connection to medium
Data Link Layer – MAC and error detection
Network Layer - Routing
Transport Layer – Segmentation and message integrity
Session Layer – Logging users on and off
Presentation Layer – encryption and file formats
Application Layer – Logical connection to host
Enhancements to the OSI – divide Data Link Layer into 2 sub-layer
-
Logical Link Control (LLC) Sub-layer (Upper) – Software issue
- flow control and automatic repeat request (ARQ) error management machanisms
-
Media Access Control (MAC) Sub-layer (Lower) – Hardware issue
- Interfaces directly with the network card
- For delivering error-free data communications
DHCP
DHCP (Dynamic Host Configuration Protocol)
- Difficult and time consuming for a network admin to enter network configuration information onto its client PCs one by one
- Provides a framework for passing configuration information to hosts on a TCP/IP network
- Can automatic allocate reusable IP, and additional configuration options
DHCP consists of two components
- A mechanism for allocation of network addresses to hosts
- A protocol for delivering host-specific configuration parameters from a DHCP server to a host
DHCP is built on a client-server model
Automatic allocation
- A DHCP server assigns a permanent IP address to a client
Dynamic allocation
- A DHCP server assigns an IP address to a client for a limited period of time
Manual allocation
- A client’s IP address is assigned by the network admin, and the DHCP server is used
simply to convey the assigned address to the client
How to allocate a network address
- Client broadcasts : DHCPDISCOVER (may include desired IP address and duration)
- DHCP server respond : DHCPOFFER (include an available network address)
- Client broadcasts : DHCPREQUEST (indicate decision)
- DHCP server respond : DHCPACK/DHCPNACK (can fulfill request/cannot fulfill)
- Client send : DHCPRELEASE (release IP for other hosts before disconnecting)
When DHCP server and client are NOT In the same LAN, DHCP relay is used
- DHCP rely listens to DHCP request broadcasted by client
- DHCP rely issues a unicast message to the DHCP server
NAT
NAT(Network Address Translation)
- Private addresses cannot be routed by the routers in the public internet
- A technology to enable hosts with private addresses to communicate with other hosts in the public internet
Operations of NAT
Operations(outbound)
Client -> NAT Router -> Public Internet -> Server
-
Router keep records (Des IP, port no.) of all outbound connections
-
The router performs NAT on each outgoing packet (private address to public
address)Operations(inbound)
Client <- NAT Router <- Public Internet <- Server -
Router performs NAT on the incoming packets (public address to private address)
-
Router forwards the responses back to its host (the client)
If the request is initiated from the public internet, NAT router cannot find the corresponding information in its record
Port Forwarding – NAT router will check the destination port number of the incoming TCP segment and forward the segment correspondingly
Best Route: shortest , fastest , cheapest
ARP (Address Resolution Protocol)
Different Cases:
- Computers connected on a bus (a chain) – computer reply message
- Computers connected through a router (default gateway) – router reply message
Wireless Local Area Network (WLAN) / Wireless Fidelity (Wi-Fi) / IEEE 802.11
Wi-Fi
Wi-Fi Standards
IEEE 802.11b (11Mbps, 2.4GHz)
IEEE 802.11g (54Mbps, 2.4GHz)
IEEE 802.11n (150Mbps, 2.4GHz and 5GHz) – support multiple inputs multiple outputs (MIMO) – 4 streams – larger coverage/ higher transmission rates
IEEE 802.11ac (866.7Mbps, 5GHz, MIMO 8 streams)
Wi-Fi Basics
- A router keeps broadcasting a BEACON message to its surrounding periodically.
- SSID (Service set identification) – the name of your network
- A client will scan all the channels and collect the BEACON messages
- To join a network, the client configure its wifi adaptor using the information obtained from the BEACON message of the targeted router. It will then send an association request to the router
Wi-Fi security
Data sent over radio channels should be encrypted
Infrastructures should be password protected such that only authenticated users can access to them
Wired Equivalent Privacy (WEP)
The first generation of security mechanism used in WLAN
Aimed to provide data confidentiality comparable to that of a wired network
Uses the Rivest Cipher 4 (RC4) for confidentiality
Pre-shared key (104 bits) + 24 bits random number known as the initialization vector (IV) -> RC4
WPA (Wifi Protected Access)
Uses TKIP (Temporal Key Integrity Protocol) for data encryption TKIP rotates the input to RC4 from time to time
WPA2 (Wifi Protected Access 2)
Use stronger Advanced Encryption Standard (AES) block cipher to replace the weak RC4 cipher
- WPA2-Personal – setup simply with Wi-Fi certified access points (routers) and devices
- WPA2-Enterprise – has ability to monitor and manage traffic, define user-specific authentication levels
DNS
DNS (Domain Name Server)
TLC (Top-Level Domain)
1/ User enters “google.com” into their browser.
2/ DNS resolver issues a request to the root server to find a TLD server that contains a list of domains for “.com”
3/ The root server replies with the IP address of the .com TLD server.
4/ A new request is sent from the resolver to the TLD server for the domain name “google.com”. The TLD server replies to the DNS resolver with the IP address for the name server for google.com.
5/ The DNS resolver contacts the name server and requests the A record
for http://www.google.com. The name server responds with the IPv4 address if an A record exists.
6/ Your machine now has the IP address to visit google.com.
Subnetting
-help to reduce broadcasting traffic
-allows to use IP addressing to break up a physical network into small logical entities called subnets
Default Subnet Mask – 255.255.0.0 Modified Subnet Mask – 255.255.254.0
Attacks
Intrusion – an attacker gains access to a remote network system
- Password cracking
- Packet sniffing * Viruses
Denial-of-Service (DOS)– attack with a goal of preventing services to a machine or network - Smurf attack
Firewalls are used in computer networks for protection against network attacks