EE445M/EE380L.12, Lecture 10 4/2/2018. EE445M/EE360L.6 Embedded and Real-Time Systems/ Real-Time Operating Systems. Lecture 10

Similar documents
EE445M/EE380L.6, Lecture 10 4/3/2016. EE445M/EE360L.6 Embedded and Real-Time Systems/ Real-Time Operating Systems. Lecture 10

Data and Computer Communications. Chapter 2 Protocol Architecture, TCP/IP, and Internet-Based Applications

EE 610 Part 2: Encapsulation and network utilities

ECE4110 Internetwork Programming. Introduction and Overview

Protocol Layers & Wireshark TDTS11:COMPUTER NETWORKS AND INTERNET PROTOCOLS

Layer 4: UDP, TCP, and others. based on Chapter 9 of CompTIA Network+ Exam Guide, 4th ed., Mike Meyers

Today. Last Time. Motivation. CAN Bus. More about CAN. What is CAN?

TCP /IP Fundamentals Mr. Cantu

Introduction to Controller Area Network (CAN)

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

Link Layer and Ethernet

Link Layer and Ethernet

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

Sirindhorn International Institute of Technology Thammasat University

Lesson 5 TCP/IP suite, TCP and UDP Protocols. Chapter-4 L05: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

Chapter 16 Networking

Transport Layer. <protocol, local-addr,local-port,foreign-addr,foreign-port> ϒ Client uses ephemeral ports /10 Joseph Cordina 2005

Lecture 17 Overview. Last Lecture. Wide Area Networking (2) This Lecture. Internet Protocol (1) Source: chapters 2.2, 2.3,18.4, 19.1, 9.

TSIN02 - Internetworking

TSIN02 - Internetworking

Links Reading: Chapter 2. Goals of Todayʼs Lecture. Message, Segment, Packet, and Frame

Introduction to Networking. Operating Systems In Depth XXVII 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

Networking Technologies and Applications

Introduction to TCP/IP networking

Medium Access Protocols

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

The OSI Model. Open Systems Interconnection (OSI). Developed by the International Organization for Standardization (ISO).

cs144 Midterm Review Fall 2010

Applied Networks & Security

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

Summary of MAC protocols

Hands-On Ethical Hacking and Network Defense

TSIN02 - Internetworking

Data Link Layer Technologies

TSIN02 - Internetworking

Lecture 6 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

RAJIV GANDHI COLLEGE OF ENGINEERING AND TECHNOLOGY

TRANSMISSION CONTROL PROTOCOL. ETI 2506 TELECOMMUNICATION SYSTEMS Monday, 7 November 2016

CSCI-GA Operating Systems. Networking. Hubertus Franke

OSI Transport Layer. objectives

ECE 650 Systems Programming & Engineering. Spring 2018

Network Model. Why a Layered Model? All People Seem To Need Data Processing

Data Link Technology. Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science

Need For Protocol Architecture

CIS 551 / TCOM 401 Computer and Network Security. Spring 2007 Lecture 7

Need For Protocol Architecture

QUIZ: Longest Matching Prefix

Significance of TCP/IP Model Divya Shree Assistant Professor (Resource Person), Department of computer science and engineering, UIET, MDU, Rohtak

The House Intelligent Switch Control Network based On CAN bus

RMIT University. Data Communication and Net-Centric Computing COSC 1111/2061/1110. Lecture 8. Medium Access Control Methods & LAN

5105: BHARATHIDASAN ENGINEERING COLLEGE NATTARMPALLI UNIT I FUNDAMENTALS AND LINK LAYER PART A

Chapter 2 Network Models 2.1

8. Networks. Why networked embedded systems General network architecture. Networks. Internet-enabled embedded systems Sensor networks

CS1302 / Computer Networks

CS61C Machine Structures Lecture 37 Networks. No Machine is an Island!

Introduction to Ethernet. Guy Hutchison 8/30/2006

UNIT - IV Ques.4 Ques.5

OSI Model with Protocols. Layer Name PDU Address Protocols Device

Layering in Networked computing. OSI Model TCP/IP Model Protocols at each layer

Interconnecting Networks with TCP/IP

Computer Networks (Unit wise Questions)

Data Communication and Network. Introducing Networks

NETWORK PROGRAMMING. Instructor: Junaid Tariq, Lecturer, Department of Computer Science

Course Introduction. Purpose. Objectives. Content. Learning Time

Computer and Network Security

Goals and topics. Verkkomedian perusteet Fundamentals of Network Media T Circuit switching networks. Topics. Packet-switching networks

Introduction to Ethernet and lab3.3

Lecture 5 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

OSI Reference Model. Computer Networks lab ECOM Prepared By : Eng. Motaz Murtaja Eng. Ola Abd Elatief

Operating Systems. 16. Networking. Paul Krzyzanowski. Rutgers University. Spring /6/ Paul Krzyzanowski

Overview of Ethernet Networking

Part3. Local Area Networks (LAN)

CS 416: Operating Systems Design April 11, 2011

Principles behind data link layer services:

Networking interview questions

Interconnecting Networks with TCP/IP. 2000, Cisco Systems, Inc. 8-1

ITEC 3800 Data Communication and Network. Introducing Networks

Review. Error Detection: CRC Multiple access protocols. LAN addresses and ARP Ethernet. Slotted ALOHA CSMA/CD

ก ก Information Technology II

Communicating over the Network

High Level View. EE 122: Ethernet and Random Access protocols. Medium Access Protocols

COMS Introduction to Computers. Networking

Principles behind data link layer services

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24

Local Area Networks. Aloha Slotted Aloha CSMA (non-persistent, 1-persistent, p-persistent) CSMA/CD Ethernet Token Ring

Chapter 2 Network Models 2.1

BABU MADHAV INSTITUTE OF INFORMATION TECHNOLOGY, UTU 2017

UDP, TCP, IP multicast

Code No: RR Set No. 1

The Link Layer II: Ethernet

Network Technology 1 5th - Transport Protocol. Mario Lombardo -

TCP/IP Transport Layer Protocols, TCP and UDP

CompSci 356: Computer Network Architectures. Lecture 8: Spanning Tree Algorithm and Basic Internetworking Ch & 3.2. Xiaowei Yang

Networking Applications

IT4405 Computer Networks (Compulsory)

Network Reference Models

System Programming. Introduction to computer networks

Computer Networks (Introduction to TCP/IP Protocols)

Raj Jain. The Ohio State University Columbus, OH

EE 122: Ethernet and

Transcription:

, 4/2/2018 EE445M/EE360L.6 Embedded and Real-Time Systems/ Real-Time Operating Systems : Networking, bus, Ethernet, Embedded Internet, TCP/IP 1 Network Collection of interfaces that share a physical medium and data protocol Actuator Sensor Communicate & synchronize tasks across computers RxD Distributed computing RxD Central Processing Remote Processing Network Remote Processing Remote Processing Remote Processing Sensor Actuator Sensor UART Gnd TxD TxD RxD B MSP430 A TM4C C TMS320 SCI RxD TxD Gnd TxD U1Tx UART Gnd U1Rx TxD Figure 9.1. A simple ring network with three nodes, linked using the serial ports. 2 1

, 4/2/2018 Network Topology Ring (previous slide) Shared bus Star Mesh Star Mesh Cluster tree PAN coordinator Full function device Reduced function device Figure 9.2. ZigBee wireless networks communicate by hopping between nodes. 3 Layered Approach Microcontroller1 ThreadB ThreadA RTOS1 Communication Messages ThreadC Microcontroller2 ThreadD RTOS2 Frames Physical link Figure 9.3. A layered approach to communication systems. Physical layer (frames) OS layer (message & packets) Application layer (sessions) 4 2

, 4/2/2018 Framing and Messaging Figure 9.19. An Ethernet frame can hold 46 to 1500 bytes. 1. Address information field Physical address specifying destination/source computer Logical address specifying destination/source processes 2. Synchronization or handshake field Physical synchronization, e.g. shared clock, start/stop bits OS/process synchronization, e.g. request/ack, semaphore 3. Data field ASCII or binary (raw or compressed) 4. Error detection and correction field Parity, checksum, error correcting codes (ECC) 5 Physical Layer Transmitter Data Energy Channel Energy Receiver Data Encoder Decoder Attenuation Distortion Noise Average signal power SNR(dB) 10 log 10 Average noise power Shannon channel capacity C = W log 2 (1 + SNR) b/s Example: Telephone channel W = 3.4kHz and SNR ~ 38 db => SNR ~ 6310 C = 3.4kHz log 2 (6311) = 3.4kHz x 12.62 b/s = 42.9 kb/s 6 3

, 4/2/2018 Controller Area Network () LM3S Controller PD0/Rx PD1/Tx Slope Control Driver Control Transceiver Dominant Detect Shutdown POR 1 LM3S 2 LM3S 112 Controller Controller PD0/Rx PD1/Tx Slope Control Driver Control Transceiver Dominant Detect Shutdown POR PD0/Rx PD1/Tx Slope Control Driver Control Transceiver Dominant Detect Shutdown POR SN65HVD1050D SN65HVD1050D SN65HVD1050D L H L H L H 120 120 Originally for use in automobiles (car area network) High-integrity serial communications Real-time applications Up to 1 Mbits/second, up to 112 nodes Half duplex (both directions, but only one at a time) 7 Bus Shared bus topology Broadcast operation Source: http://can-cia.org/index.php?id=can 8 4

, 4/2/2018 Protocol Message Frame Bus Idle Arbitration field Control Data field CRC field ACK EOF IFS 11-bit Identifier DLC Data (0-8 bytes) 15 bits Bus Idle SOF RTR r0 IDE/r1 Delimiter Delimiter Slot Figure 9.7. Standard Format Data Frame. Data, Remote, Error or Overload frames Arbitration Field 11-bit identifier specifies data type (not address), e.g. Ping, IR, RTR=IDE=0 means 11-bit standard format data frame Control Field DLC specifies the number of data bytes (0 to 8) Data Field Contains zero to eight bytes of data CRC Field 15-bit checksum used for error detection 9 Wired-AND logic Signaling Similar to wired-or or open collector logic 5V 3.5V 2.5V 1.5V 0V Recessive Dominant Recessive H L Time Dominant state is logic low (0) Recessive state is logic high (1) 10 5

, 4/2/2018 Arbitration Bit-wise arbitration Priority handled by dominant win over recessive Lower IDs are higher priority Source: http://can-cia.org/index.php?id=can 11 Bandwidth Bandwidth = number of information bits/frame total number of bits/frame baud rate Number of bits in a message frame ID: 11 or 29 bits Standard 2.0A vs. extended 2.0B Data: 0, 8, 16, 24, 32, 40, 48, 56, or 64 bits Remaining components: 36 bits SOF (1) RTR (1) IDE/r1 (1) r0 (1) DLC (4) CRC (15) ACK/EOF/intermission (13) How many bits in a frame: Standard 2.0A frame with 4 data bytes? Extended 2.0B frame with 8 data bytes? 12 6

, 4/2/2018 Synchronization Synchronous bit transmission Where is the clock? (Answer: in the data) Needs edges so the receiver can synchronize A long sequence of 0 s or a long sequence of 1 s Bit stuffing Insert complementary bit after five equal bits 2.0A may add 3+n stuff bits (n is number of bytes) 2.0B may add 5+n stuff bits Receiver has to un-stuff 13 TM4C123 Modules 2 Modules Message RAM 32 Msg. Objects Message Objects Tx Objects One-time Remote request Rx Objects Receive filters Can be concatenated into FIFOs 14 7

, 4/2/2018 Microchip MCP2551 Transceiver http://www.microchip.com/wwwproducts/devices.aspx?ddocname=en010405 http://ww1.microchip.com/downloads/en/devicedoc/21667f.pdf 15 Interfacing There must be a 120 resistor on each end of the cable, and no resistor on middle nodes. A transmission line if L > /4, = v/f v Slew rate = 25V/µs, v = VF*c = 2 10 8 m/s 1V in 40 ns, = 2 10 8 m/s * 40*10-9 s = 8m, /4 = 2m 16 8

, 4/2/2018 Simple Network TivaWare driver Init BitRateSet Enable IntEnable MessageSet IntStatus StatusGet MessageGet LM3S8962 Switch LED LM3S2110 Switch LED 0_SendData 0_GetMail NonBlock 0_SendData 0_GetMail NonBlock ISR ISR ID=4 ID=2 ID=2 ID=4 _4C123.zip bus BitRateSet(0_BASE, 80000000, _BITRATE); 17 Logic Analyzer Traces Transmit Frame Why did it take 130 s to execute _Transmit? Why does the RxCan have more stuff than the TxCan? Receive Frame What is the total number of bits in this frame? Why did it take 110 s to complete an entire frame? What is that blimp on TxCan? Where is the end of the frame? What is the bandwidth? 18 9

, 4/2/2018 Synchronization Issues How to connect transmitter/receiver threads? How to start, handshake Race conditions How to prevent streaming data from stalling? Priority, buffer size 19 Ethernet Bus-based topology Hub (repeater) or switch A Ethernet B A B C D Ethernet switch Physical layer Many variants evolved over the years Pin Color Pair Description 1 white/orange 2 TxData + 2 orange 2 TxData - 3 white/green 3 RecvData + 4 blue 1 5 white/blue 1 6 green 3 RecvData - 7 white/brown 4 8 brown 4 Table 9.2. Pin assignments on a 568-B Ethernet connector. 20 10

, 4/2/2018 568-B Ethernet Cabling 568-A 1 2 3 4 5 6 7 8 TxData+ TxData- RecvData+ RecvData- Pair 2 Pair 3 Pair 1 Pair 4 RecvData+ RecvData- TxData+ TxData- 1 2 3 4 5 6 7 8 LM3S8962 Switch Figure 9.15. Ethernet cable between a microcontroller and a switch. 568-B 568-B 1 2 3 4 5 6 7 8 LM3S8962 TxData+ TxData- RecvData+ RecvData- Four twisted pairs TxData+ TxData- RecvData+ RecvData- 1 2 3 4 5 6 7 8 LM3S8962 Figure 9.16. Ethernet cross-over cable between two microcontrollers. 21 Ethernet Protocol Ethernet Frame Synchronization preamble (alternating 0/1) Start frame delimiter (SFD) Source & destination MAC addresses Type/length field Data CRC frame check sequence (FCS) 22 11

, 4/2/2018 Media Access Control (MAC) Distributed arbitration protocol Obsolete if centralized switches are used Carrier Sense Multiple Access with Collision Detection (CSMA/CD) Sense free carrier before sending Sense while transmitting to detect collision If collision, send jam signal Binary exponential backoff Increment collision counter c Wait random period in range 0 2 c -1 23 ISO/OSI 7-Layer Model Abstraction International Standards Organization (ISO) Open Systems Interconnection (OSI) User Application layer Presentation layer Session layer Transport layer Network layer Data link layer Physical layer User Physical link 24 12

, 4/2/2018 TCP/IP 4-Layer Realization OSI Application Presentation Session Transport Network Data link Physical TCP/IP Application Transport Internet Media Access Control/Physical Layers Examples HTTP, Telnet, SMTP,FTP TCP TCP, UDP IP, ICMP, IGMP Ethernet, wifi 25 Message Protocols Transmission Control Protocol (TCP) User Datagram Protocol (UDP) Internet Protocol (IP) Domain Name System (DNS) 32-bit IPv4 address 128-bit in IPv6 Ethernet Error checking Padding Payload Ethernet frame IP datagram TCP segment IP header TCP header TCP header Appl header User Data User Data Application Data Application Data Ethernet header IP header TCP header Application Data Ethernet trailer 22 20 20 4 bytes 46 to 1500 bytes Application TCP IP Ethernet 26 13

, 4/2/2018 UDP and TCP UDP single datagram (connectionless) 8-byte header Source port: 16-bit number of the process that sent the packet, could be zero Destination port: 16-bit number of the process to receive the packet. Length: 16-bit number specifying the size in bytes of the data to follow Checksum: 16-bit modulo addition of all data, UDP header, and IP header TCP session stream (error & flow control) 20-byte header Source port: 16-bit number of the process that sent the packet, could be zero Destination port: 16-bit number of the process to receive the packet. Sequence number: 32-bit number defining the position of this data Acknowledgement: 32-bit number of the next data expected to be received Hlen: 4-bit field of the header size (including options) divided by 4 Flags: 6-bit field with FIN, SYN, RST, PSH, ACK, and URG Window: 16-bit number specifying the number of bytes the receiver can accept Checksum: 16-bit modulo addition of all data, TCP header, and IP header Urgent pointer: 16-bit field pointing to a place in the stream urgently needed 27 Application Protocols Client/server models HTTP (web), FTP, Telnet, SSH, Providing (device) services over the web XML-based protocol: SOAP, WSDL Simpler REST-ful API styles Request encoded in URL Return data using XML, JSON, formats 28 14

, 4/2/2018 Embedded Internet Internet of Things (IoT) Actuator Sensor Central Server Smart object Microcontroller Internet Smart object Microcontroller Sensor Smart object Microcontroller Actuator Smart object Microcontroller Sensor Internet standardization: TCP/IP Protocol FTP FTP TCP TCP IP Hop Hop IP Ethernet Router Internet Router Ethernet Reference: W. Richard Stevens TCP/IP Illustrated, Volume 1: The Protocols 29 Networking Summary Standardization is key Communication standards Across levels/layers Physical, OS, application IoT is an open playing field Internet as well-established foundation Application-level standardization? Embedded device-to-device interactions 30 15