ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

30
ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng

Transcript of ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

Page 1: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 Embedded Systems

Design

Networking ConnectivityChapter 12Ning Weng

Page 2: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 2

Networking Overview• Goal: key concepts and system details to

integrate network connectivity into embedded systems

Ning Weng

Page 3: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 3

Global Internet Bandwidth

Ning Weng

Page 4: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 4

UDP Packet Sender

Ning Weng

Page 5: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 5

UDP Packet Sender in C

Ning Weng

Page 6: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 6

Socket API

Ning Weng

Page 7: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 7

Protocol Layers

Ning Weng

Page 8: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 8

IP Layer Packet Headers

Ning Weng

Page 9: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

9

Comparison: IPv4&6 header

Page 10: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 10

Transport Layer Headers

Ning Weng

Page 11: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

TCP connections

This diagram shows the start of a TCP connection.

A sends packet X withSYN. “Hello I would like to talk”.B sends a SYN, ACKpair “I got yourmessage. I wouldalso like to talk”A sends an ACK (andsome data) “Igot your message,here is some data.”

Page 12: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

TCP Window Increase/Decrease

Transmission no

Threshold

Threshold

Congestion window

The initial doubling of thewindow size is called “slowstart”.

Timeout

Page 13: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 13

Encapsulation

Ning Weng

Page 14: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 14

Example of Switched Ethernet LAN

Ning Weng

Page 15: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 15

Ethernet Frame Format

Ning Weng

Page 16: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 16

Ethernet Controller

Ning Weng

Page 17: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 17

WI-FI• Short of wireless fidelity

─ Dominant wireless LAN technologies─ Relying on availability of unlicensed radio frequency

• High f -> affected by various medium• Security: dos, unauthorized access and etc.• Wireless medium access control

Ning Weng

Page 18: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 18

IEEE 802.11 Data Frame

Ning Weng

Page 19: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

Basic Security Strategies• Block your Service Set Identifier (SSID) from being

broadcast.─ Wireless beacon so PCs can easily find the access point.

• Change the default network name in the access point.

• Change the default access point password.• Center the access point in the middle of the

building/house.

Page 20: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

Media Access Control (MAC) Filtering

• Every network device has a unique MAC address─ Allocated by the manufacturer.

• MAC Filtering only allows certain addresses access.

• Mostly for home use.─ Tedious to implement on a large scale

Page 21: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

Wired Equivalency Protocol (WEP)

• Basic encryption technology.─ Uses an RC4 stream cipher.

• Pseudo-random bytes.─ Two versions: 64-bit and 128-bit versions.

• Built into Wi-Fi certified equipment.─ Implemented at the MAC level.

• Protects radio signal between device and access point.─ Does not protect data beyond the access point.

• Uses static encryption keys.─ Easy to crack.

• Still better then nothing.

Page 22: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

Wi-Fi Protected Access (WPA)• Designed to replace WEP.

─ Firmware update. ─ 128-bit Temporal Key Integrity Protocol (TKIP)

encryption. • Uses a master key that is regularly changed.

─ User authentication.─ Data Integrity.

• Protects radio signal between device and access point.

• Built into Wi-Fi certified equipment.─ Implemented at the MAC level.

• Available in two versions:─ WPA2 Personal.─ WPA2 Enterprise.

Page 23: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

Wi-Fi Protected Access 2 (WPA2)

• Designed to replace WEP.─ 128-bit Advanced Encryption Standard (AES).

• Based on the IEEE 802.11i standard.• Provides government level security.• Also available in two versions:

─ WPA2 Personal.─ WPA2 Enterprise.

Page 24: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 24

Wireless Media Access Control

• MAC protocol: shared media scheduling• maximize number of communications• Ensure fairness among all transmitters

• CSMA – carrier sensing multiple access• CD – collision detection

─ If (Transmitted_Signal != Sensed_Signal) Sender knows it’s a Collision ABORT

• Wireless problem─ Can not send and listen ─ Signal not same at same

Ning Weng

Page 25: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

25

Bluetooth Overview• Bluetooth is a global, RF-based (ISM

band: 2.4 GHz), short-range, connectivity solution for portable, personal devices─ it is not just a radio, it is an end-to-end solution

• The Bluetooth spec comprises─ a HW & SW protocol specification─ usage case scenario profiles and interoperability

requirements

• IEEE 802.15.1 is working on standardizing the PHY and MAC layers in Bluetooth

• More Info:─ http://www.bluetooth.org ─ http://ieee802.org/15/pub/TG1.html

Page 26: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

Bluetooth - Piconet• A collection of devices connected via

Bluetooth technology in an ad hoc fashion. • A piconet starts with two connected

devices, and may grow to eight connected devices.

• All Bluetooth devices are peer units and have identical implementations. However, when establishing a piconet, one unit will act as a Master and the other(s) as slave(s) for the duration of the piconet connection.

Page 27: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

27

Application Framework and Support

Link Manager and L2CAP

Radio & Baseband

Host Controller Interface

RF

Baseband

AudioLink Manager

L2CAP

Other TCS RFCOMM

Data

The Bluetooth protocols

• A hardware/software description• An application framework

SDP

Applications

Control

Page 28: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 28

Linux Networking• Networking utilities

─ Ipcofig─ Netstat

• Socket implementations

• Networking kernel structures

Ning Weng

Page 29: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 29

Linux Network Stack

Ning Weng

Page 30: ECE 424 Embedded Systems Design Networking Connectivity Chapter 12 Ning Weng.

ECE 424 30

Struct SK_buff

Ning Weng