TWR-MCF52259-Ethenet
Hareesh S
Sr.FAE
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Ethernet Router
Ethernet Overview Session
Ethernet NIC
Ethernet Switch
Ethernet Cables
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Ethernet Connector
TM
1
What is Ethernet?
•
It’s a cable I connect to my computer to surf the net
•
It’s how I do emails
•
My home router uses it to let all my computers talk
Why do we care about Ethernet?
•
Work is telling me I need it for my embedded product
•
It will let me remotely access my embedded product
•
Seems to be a cool way to have fast downloads
How will I use Ethernet?
Ethernet Overview Session
•
Just in factory application (i.e. local only)
•
Connected to WLAN (i.e. publicly accessible)
•
Through VPN only (i.e. secure tunnel)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
2
Ethernet
Ethernet defines the mechanical/electrical connection between
devices (the physical layer).
Ethernet also defines a protocol used to communicate between
multiple devices (the MAC layer).
Ethernet is defined by the IEEE 802.3 standard
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
3
ColdFire
ColdFire
On-Chip
®
®
Generic ColdFire ®Board Layout of Ethernet
MII – Media Independent Interface
Network
Network
Cable
Ethernet
PHY
PHY
MAC-Media Access Controller
PHY-Physical Layer
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Magnetics
Magnetics
Isolation
And
optional PoE
RJ45
RJ45
Jack
Line Voltage Levels
+2.8V or -2.8VDC
4
RJ45
RJ45
TM
MCF5223x
MCF5223x
M52233DEMO Board Layout of Ethernet
Network
Network
On-Chip
Ethernet
PHY
w/ PHY
MAC-Media Access Controller
PHY-Physical Layer
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
PHY
Magnetics
Magnetics
Isolation
And
optional PoE
Cable
RJ45
RJ45
Jack
Line Voltage Levels
+2.8V or -2.8VDC
5
RJ45
RJ45
TM
Connectors
• RJ-45
Cables
• CAT-5
Ethernet Overview Physical Session
24 AWG solid
bare copper
Four unbounded
twisted pairs
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
6
Ethernet Cable: Straight Through Pinout
The following table demonstrates the proper color scheme.
Wire pair #1:
Wire pair #2:
Wire pair #3:
Wire pair #4:
White/Blue
Blue
White/Orange
Orange
White/Green
Green
White/Brown
Brown
RJ-45
Pin
Sign
al
Directi
on
RJ-45
Pin
1 ---> TX+ 1
2 ---> TX- 2
3 <--- RX+ 3
4 - - 4
5 - - 5
6 <--- RX- 6
7 - - 7
Source: http://www.netspec.com/helpdesk/wiredoc.html
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
8 - - 8
TM
7
Ethernet Cable: Crossover Pinout
The following is the proper pin out and cable pair/color order for the "crossover" end.
Pair#2 is connected to pins 1 and 2 like this:
white/green Pin 1 wire color:
green Pin 2 wire color:
Pair#3 is connected to pins 3 and 6 like this:
white/orange Pin 3 wire color:
orange Pin 6 wire color:
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
8
* Distance Signal Travels at 100 Mbits?
Name Transmission Medium Data Rate
(Mb/s)
100BASE-TX 2 pairs of Category UTP-5,
alternative 2 pairs of STP, 150 Ω
Impedance, Cable Code MLT-3,
Full Duplex
100BASE-FX 2 Multimode Optical Fiber (62.5/125
µ m), Cable Code 4B5B, NRZI, Full
Duplex
1 0 0 B A S E - T 4 4 p a i r s o f C a t e g o r y 3 U T P - ( 3 / 4 / 5 ) o r
b e t t e r , 1 0 0 Ω I m p e d a n c e , C a b l e
C o d e 8 B 6 T , N o F u l l D u p l e x
1 0 0 B A S E - T 2 2 p a i r s o f C a t e g o r y 3 U T P - ( 3 / 4 / 5 ) o r
b e t t e r , C a b l e C o d e P A M 5 , F u l l
D u p l e x
x
3
2
2
S
u
p
p
o
t
r
e
d
b
y
CF
M
5
100 100
100 2,000
1 0 0 1 0 0
1 0 0 1 0 0
Requires using external PHY
Distance
(m)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
9
TM
Full Duplex Ethernet Links
Full duplex operation means that devices at each end of a full duplex
link can send and receive data simultaneously.
This means, theoretically, that Full Duplex has twice the bandwidth of
normal (half duplex) Ethernet.
Since there are only two devices on a full duplex link, there is no shared
channel and no collisions.
CSMA/CD protocol
prevents this
Full Duplex Half Duplex
DTE
DTE
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
R
DTE
DTE
DTE
10
S
DTE
TM
Hub
= Multiport
repeater
Basic Ethernet Network
Ethernet
Switch
Router/Gateway
= Switching
physically
star
topology
(common
transport
medium
CSMA/CD!)
Logically
bus
topology
Outputs all
incoming
signals on
Hub, LAN
Switch
Real star
topology
Physical
connection
only for the
duration of the
communication
all outputs
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
11
Basic Ethernet Bus
Co-axial based Ethernet connection daisy chain connection
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
12
Collisions
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
13
HUB
Centralized connection
Can bypass not connected
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
14
Switch
The switch reads the destination addresses and 'switches' the signals
directly to the recipients without broadcasting to all of the machines on
the network.
This 'point to point' switching alleviates the problems associated with
collisions and considerably improves network speed.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
15
Ethernet Router/Gateway
A Router or Gateway is used to translate one protocol to
another.
It is also used when the physical layer changes mediums.
Ethernet to fiber
At one time there was a difference between a router and a
gateway.
The gateway was strictly used as a medium translator (
electrical ) and the router was strictly used as protocol
translator ( software ).
Now routers and gateways are normally combined and
called a routers.
Note: Ethernet to WiFi is a router functionality.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
16
*Media Independent Interface (MII)
• The MII links the Ethernet MAC with
the PHY.
• An MII may support both 10-Mb/s and
100-Mb/s operation, allowing network
devices to connect to both 10BASE-T
and 100BASE-T media segments.
• The MII electronics may be linked to
an outboard transceiver through a
40-pin MII connector and a short
(0.5m) MII cable.
• The MII is internally connected to the
EPHY on the MCF5223x
4-bit wide Tx and Rx data @2.5MHz or 25MHz
TTL signal levels
Typical MII Interface
TXDn_<3:0>
TX_ERn
TX_ENn
TX_CLKn
RXDn_<3:0>
RXDVn
(MAC)
Controller
Media Access
RX_ERn
RX_CLKn
CRSn
COLn
Magnetics/Fiber Transceiver
PHY
with
MII
Full duplex
Media status signals:
Carrier Presence & Collision
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
17
*Autonegotiation
Auto-Negotiation is the exchange of information about each stations
abilities over a link segment allows the stations to achieve the best
possible mode of operation.
The highest performance mode of operation that Auto-Negotiation can
achieve is based on a priority table.
The Auto-Negotiation protocol contains a set of priorities which result
in the devices selecting their highest common set of abilities.
If the devices at both ends of the link can support full duplex
operation, and if they also both support Auto-Negotiation of this
capability, then they will automatically configure for full duplex.
The priorities are listed in the table below...
Auto-Negotiation priority Resolution Table
A 100 Base-TX Full Duplex
B 100 Base-T4
C 100 Base-TX
D 10 Base-T Full Duplex
E 10 Base-T Half Duplex
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Full duplex is given a
higher priority than
half duplex, since it
can send more data.
TM
18
The Ethernet Data Packet Format
Ethernet Data Frame – old/original format used
Preamble
Destination
Address
Source
Address
Frame
Type
Frame
User Data
FCS
Checksum
8 Byte 6 Byte 6 Byte 2 Byte 46 – 1500 Byte 4 Byte 64-1518
IEEE 802.3 Data Frame
SOF
Destination
Preamble
Address
7 Byte 1 Byte 2/6 Byte 2/6 Byte 2 Byte 46 – 1500 Byte 4 Byte
Source
Address
Length
Type
Frame
User Data
DSAP SSAP Control Data
FCS
Checksum
1 Byte 1 Byte ½ Byte
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
19
Terminology
CSMA - Carrier Sense Multiple
Access
CD - Collision Detection
OSI - Open Systems
Interconnection
ISO - International Organization
for Standardization
LAN - Local Area Network
WAN- Wide Area Network
MAC - Medium Access Control
BD - Buffer Descriptor
PHY - Physical Layer Device
MDI - Medium Dependent
Interface
CRC - Cyclic Redundancy Checking
FCS - Frame Checksum
IP - Internet Protocol
TCP - Transmission Control
Protocol
UDP - User Datagram Protocol
ICMP - Internet Control Message
Protocol
FEC - Fast Ethernet Controller
MII - Media Independent Interface
AUI - Attachment Unit Interface
DTE - Data Terminal Equipment
MAU - Medium Attachment Unit
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
20
Ethernet Definition…
Ethernet - http://dictionary.reference.com/search?q=Ethernet
<networking> A local area network first described by
Metcalfe & Boggs of Xerox PARC in 1976. Specified by DEC ,
Intel and XEROX (DIX) as IEEE 802.3 and now recognised
as the industry standard.
Data is broken into packets and each one is transmitted
using the CSMA/CD algorithm until it arrives at the
destination without colliding with any other packet. The
first contention slot after a transmission is reserved for
an acknowledge packet. A node is either transmitting or
receiving at any instant. The bandwidth is about 10 Mbit/s.
Disk-Ethernet-Disk transfer rate with TCP/IP is typically 30
kilobyte per second.
Version 2 specifies that collision detect of the transceiver
must be activated during the inter-packet gap and that when
transmission finishes, the differential transmit lines are
driven to 0V (half step). It also specifies some network
management functions such as reporting collisions, retries
and deferrals .
Ethernet cables are classified as "XbaseY", e.g. 10base5,
where X is the data rate in Mbps , "base" means "baseband "
(as opposed to radio frequency ) and Y is the category of
cabling. The original cable was 10base5 ("full spec"),
others are 10base2 ("thinnet") and 10baseT ("twisted
pair") which is now (1998) very common. 100baseT ("Fast
Ethernet") is also increasingly common
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
21
More Ethernet References
Web sites:
•
http://www.tcpipguide.com/
• http://www.uni-trier.de/infos/ether/ethernet-guide/ethernet-
guide.html#HDR%202.0%20%20%202%2062
• http://www.lauraknapp.com/presentation.htm
• http://www.ethermanage.com/ethernet/ethernet.html
• http://osiris.sunderland.ac.uk/online/ethernet/ethernet.html
• http://computer.howstuffworks.com/ethernet.htm
References:
Ethernet, The Definitive Guide
Charles E. Spurgeon
O'Reilly
2000
ISBN 1-56592-660-9
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
22
IP - Internet Protocol
The IP defines how a network of more then 2 devices is formed. IP
is the network Layer.
IPv4 uses 32 bit addressing
IPv6 uses 128 bit addressing
A IPv4 node is defined by its IP address , and subnet mask.
•
IPv4 sample address 192.168.1.0 subnet 255.255.255.0
A IPv6 node is defined by its IP address
IP
•
2001:0DB8:0000:0000:0000:0000:1428:57ab
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
23
IP Classes
With IP V4 , there are not enough IP addresses for everbody.
To solve this problem , subnetting is used.
IP addresses consists of 2 parts, a node address and a network
address.
The class of the address and the subnet mask determine which part
belongs to the network address and which part belongs to the node
address.
Each class is defined by the first 4 bits of the IP address.
•
Class A = 0xxx, or 1 to 126
•
Class B = 10xx, or 128 to 191
•
Class C = 110x, or 192 to 223
•
Class D = 1110, or 224 to 239
•
Class E = 1111, or 240 to 254
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
24
IP Subnetting
Each IP address contains a node address and a network address.
The subnet mask determines which bits identify a node address, and
which bits identify a network address.
The network bits are the 1’s, the node bits are the 0’s.
Default subnet masks
•
Class A – 255.0.0.0 255 networks, > 16million nodes
•
Class B – 255.255.0.0 64K networks, 64K nodes
•
Class C – 255.255.255.0 >16 million networks, 255 nodes
CIDR = Classless Inter Domain Routing
Eliminates class restrictions giving finer control to netmask.
Uses 192.168.1.99/24 nomenclature ( 24 = # of ones from left )
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
25
IPv4 network classes
Your IP address identifies the “neighborhood” your node is in.
“Private IP addresses” are not assigned by the IANA (Internet Assigned
Numbers Authority)
Total # of addresses Class RFC Purpose CIDR Equivalent Addresses
0.0.0.0 - 0.255.255.255
10.0.0.0 - 10.255.255.255
127.0.0.0 -
127.255.255.255
169.254.0.0 -
169.254.255.255
172.16.0.0 - 172.31.255.255
192.0.2.0 - 192.0.2.255
192.88.99.0 - 192.88.99.255
192.168.0.0 -
192.168.255.255
198.18.0.0 - 198.19.255.255
224.0.0.0 -
239.255.255.255
240.0.0.0 -
255.255.255.255
16,777,216 ARFC 1700Zero Addresses 0.0.0.0/8
16,777,216 ARFC 1918 Private IP addresses10.0.0.0/8
16,777,216 ARFC 1700Localhost Loopback Address 127.0.0.0/8
65,536 BRFC 3330 Zeroconf169.254.0.0/16
1,048,576 BRFC 1918 Private IP addresses172.16.0.0/12
256 CRFC 3330Documentation and Examples 192.0.2.0/24
256 CRFC 3068 IPv6 to IPv4 relay Anycast 192.88.99.0/24
65,536 CRFC 1918 Private IP addresses192.168.0.0/16
131,072 CRFC 2544Network Device Benchmark198.18.0.0/15
268,435,456 DRFC 3171 Multicast224.0.0.0/4
268,435,456 ERFC 1700Reserved 240.0.0.0/4
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
26
NAT
Network Address Translation (NAT, also known as network masquerading or IP-masquerading )
involves re-writing the source and/or destination addresses of IP packets as they pass through a
router or firewall.
Most systems using NAT do so in order to enable multiple hosts on a private network to access the
Internet using a single public IP address.
NAT is a non-standard protocol
Local
192.168.1.1
192.168.1.2
192.168.1.3
192.168.1.4
192.168.1.5
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Router/Gateway
running NAT
IP=10.1.2.3
Default Gateway is where packets
addressed outside the subnet are
sent to.
Global
10.1.2.3 192.168.1.0
internet
TM
27
Default Gateway
192.168.1.1
192.168.1.2
Router/Gateway
10.1.2.3 192.168.1.0
internet
running NAT
192.168.1.3
IP=10.1.2.3
192.168.1.4
Default Gateway is where packets
192.168.1.5
addressed outside the subnet are
sent to.
Local Global
Node 192.168.1.5 needs to send a packet to 207.68.172.246 (msn.com)
Node 192.168.1.5 identifies that 207.68.172.246 is outside the subnet
(255.255.255.0 )
The packet is sent to 192.168.1.0, the default gateway
NAT translates the source field to 10.1.2.3
The internet sees a packet from 10.1.2.3 to 207.68.172.246
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
28
Getting packets into a NAT network
Default
node gets
all packets
from
internet
from
connection
s not
originated
from
subnet
Local
192.168.1.1
192.168.1.2
Router/Gateway
Global
10.1.2.3 192.168.1.0
internet
running NAT
192.168.1.3
IP=10.1.2.3
192.168.1.4
Default node is where all packets
192.168.1.5
from internet that are not responses
to packets from subnet are routed
to.
If the connection originates from the internet ( like connecting to a web
server on an embedded device ) NAT has a default node.
The default node is defined in the router/gateway.
Some routers/gateways always default to x.x.x.1
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
29