EE250Unit2_NetworkBasics
EE250Unit2_NetworkBasics
EE 250 Unit 2
Introduction
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 |
NETWORKING OVERVIEW
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 4
Definitions
• What is a computer network?
– A set of devices (nodes) that can communicate with each
other over some form of communications channel
• Helpful definitions
– Medium: the material used to carry the signals or means of
transmission (wire, fiber, air)
– Channel: Link between devices (sometimes interchangeable
with medium)
– A node: A device able to receive and send data
– Half-duplex: Can only send or receive but not both at the
same time
– Full-duplex: Can send and receive at the same time
• Goal of a network
– Efficiently communicate data from one device to
another
• Network metrics
– Throughput (Bandwidth): total bits per second that
can be transferred
– Latency: time it takes to deliver a message
– Reliability
– Energy-efficiency
– Others
• Jitter (variability of inter-arrival times), cost, distance,
availability, etc. This Photo by Unknown Author is licensed under CC BY-SA
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 |
6
https://www.visualcapitalist.com/paper-map-early-internet/
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 |
https://en.wikipedia.org/wiki/ARPANET
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 8
Thought Experiment
• Suppose we lived decades ago when networks were non-existent until we effectively
thought of them and wanted to create a web browser running on one machine and
communicate with a webserver on another via some common wired access point
• We hired some other USC engineers to develop the ENTIRE network solution from
software down to hardware as a single, monolithic solution to enable me to send
web requests and responses back and forth between the two machines over the
wired connections
• What might change that would make this monolithic solution a bad choice?
@app.route('/')
def index():
return render_template('index.html')
Network Challenges
• Q: To meet our goal (communicating information) and
Router
achieve specific metrics, what challenges and problems Network A
Hub
do we need to solve?
• Potential answers:
– Signaling: How should data be represented electronically (i.e. signaling)
when communicated over the medium? Internet
– Synchronization: How does the receiver know when I'm sending?
– Medium access: How do I share the medium with other devices?
Router
– Routing: How do I route data across multiple hops or entire networks?
– Security/Integrity: How do I ensure the integrity of the data I send?
– Interoperability: How do I interconnect different kinds of networks?
– Multiplexing: How do I share a single network connection on a system Network B
with multiple apps?
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 10
Network Layering
• To solve these issues in a modular way,
networks often follow a layered approach
– Each layer has well-defined responsibilities
and is intended to solve certain issues
(separation of concerns)
– Alternate implementations of a layer can be
swapped with minimal effect on neighboring
layers (TCP vs. UDP, 802.11x vs. wired
Ethernet)
• OSI model: 7 layer general template for
networks
– Not all layers must be implemented
• Internet model: 5 layer model
– Combines top 3 layers into "Application Layer" https://www.lifewire.com/layers-of-the-osi-model-illustrated-818017
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed. https://commons.wikimedia.org/wiki/File:Osi-model-7-layers.png
EE250 | Networking Basics | Unit 2 | 11
Internet Model
• Application
– Software application that uses the network capabilities
– Example: Browser (http), ssh, E-mail (smtp)
• Transport Messages Layer 5:
– Provides reliability (error-detection) and coordinates multiple applications Application
sharing access to the network through the use of "ports"
Logical Sharing / Layer 4:
– Example: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol)
Host-to-host Transport
• Network
– Provides network-to-network routing capabilities using logical address Layer 3:
End-to-end
– Example: IPv4 and IPv6 (Internet Protocol) Routing Network
• Data Link (Medium Access Layer) Single-hop Layer 2:
– HW/SW for transmitting a message one hop (just to the next node on the overall Delivery Data Link
route) using physical addresses Signaling of bits Layer 1:
– Example: Wired Ethernet 802.3, Wireless Ethernet 802.11, 802.15.x Zigbee, Physical
Bluetooth
• Physical
– Actual wire or wireless link/carrier
– Example: CAT 5 Wire, Radio-Frequency Wireless transmission
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 12
Internet Applications
Application Layer Protocols
Hourglass
Architecture with a Transport Layer Protocols
Narrow Waist:
“Everything runs over Network Layer Protocols
IP and IP runs over
everything”
https://www.linkedin.com/pulse/iot-connected-world-key-architectural-design-david-kuriakose-pmp
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 13
• 1969 - ARPANet - The 1822 protocol (implemented the physical, link, and network
layers)
• 1970 - ARPANet - NCP - Network control protocol
• 1970’s-1980’s: Telnet, FTP, SMTP, DNS
• 1970’s-1980’s - TCP and IP - Invented by Robert Kahn and Vint Cerf; Developed 1974-
1978, production version in 1983
• Late 1980’s - Full deployment of the TCP/IP Suite of Protocols, alternatives to
ARPANet created, such as NSFNet and commercial networks
• 1989 - Invention of the World Wide Web by Tim Berners-Lee
• 1990 ARPANet officially decommissioned
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 14
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 15
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 |
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 18
PHY Layer
CC BY-NC-ND
CC BY-SA
CC BY-SA
CC BY-SA
CC BY
Author is licensed under
Author is licensed under
Author is licensed under
Author is licensed under
Author is licensed under
• Two devices can directly communicate with each other via physical signaling (e.g.
RS-232 serial from EE 109)
• May use various physical mediums (wireless, fiber, etc.) and signaling techniques
CC BY-NC-ND
CC BY-SA
CC BY-SA
CC BY-SA
CC BY
Author is licensed under
Author is licensed under
Author is licensed under
Author is licensed under
Author is licensed under
• The MAC layer adds ability for multiple devices to share a common
communications medium/channel
• It also adds physical addressing (specific to the hardware device) to identify each
Switch
A Client B C Client Router Client Server
K Client Client
CC BY-NC-ND
Switch
CC BY-SA
CC BY-SA
CC BY-SA
CC BY
Switch
Client Client
Phys. Addr MAC A MAC B MAC C G MAC MAC H MAC D MAC MAC F
CC BY-NC-ND
PHY Switch
CC BY-SA
CC BY-SA
CC BY-SA
CC BY
Client Client Router Client Server
TRPT TRPT
TCP TCP
Header
App. Data Transport Header
App. Data
IP IP
Header
Transport Data Network Header
Transport Data
Ethernet Ethernet
Header
Network Data Data Link Header
Network Data
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed. Physical Link
EE250 | Networking Basics | Unit 2 | 24
CC BY-NC-ND
CC BY-SA
CC BY-SA
CC BY-SA
CC BY
Client Server
Fragmentation
• As an idea that captures the benefit and working of encapsulation, any layer can
FRAGMENT the message it receives from an upper layer and send each fragment as
an INDEPENDENT message and possibly take different routes through the network
• Each layer below the fragmenting layer sees INDEPENDENT messages
• Upon receipt of the independent messages, the fragmenting layer on the receiver
can REASSEMBLE them into a single message and pass it up to the higher layer as if
nothing happened.
CC BY-NC-ND
CC BY-SA
CC BY-SA
CC BY-SA
CC BY
Client Server
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 27
Protocols
– Rules for the format of data so that receivers know how to interpret
what they receive
• Networks are full of protocols so get ready!
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 28
+2
+1
+1
0
– Specifies physical addresses to indicate source and destination
-1
-2
computers
11 00 01 11 - 10
time
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 29
Hub
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
This Photo by Unknown Author is licensed under CC BY-SA
EE250 | Networking Basics | Unit 2 |
Algorithm
1. Wait for data to transmit
2. if (someone is already transmitting)
Wait until transmission is complete
3. Begin your transmission and while
transmitting, listen for collision
4. if (collision)
wait for a random "backoff" time and start
again (go back to step 2)
5. Done
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 31
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 32
Switched Ethernet
• Switches replaced hubs
– Provides full-duplex connections
• Switch learns what address is attached to each port.
Can you guess how?
– By looking at the source address of incoming frames on that
port
• Incoming traffic is forwarded only to the appropriate
output port
Switch
• Allows multiple, simultaneous connections
• Allows full duplex transmission - two way
communication (send and receive at the same time)
• Only broadcasts if address not known
• Removes need for CSMA/CD but requires flow control
(i.e. method for receiver to tell transmitter to slow
down/stop)
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 33
IP (Internet Protocol)
• Layer 3 (Network layer) implementation
• Focused on logical organization of networks
– Deals with issues of connecting different, separately owned networks
• Assigns logical addresses not tied to specific hardware
– Different than physical address
– Your phone number is not tied to 1 phone but can be transferred to a new
hardware device, so logical addresses are not fixed to a device
– Range of contiguous addresses assigned to logical group of computers (a
department of a business, all of USC computers, etc.)
• Deals with routing messages
– Finding an (efficient) path from the source to the destination (potentially across
the globe)
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 34
Internet Diagram
128.125.32.74
• IP is required since different networks
may use different data-link layers 128.125.225.254
Router
• IP addresses are broken into Network A
Switch
network/host sections
– Example: 128.125 identifies USC's network,
while the last two numbers identify a 128.125.100.58
particular host/node
Internet
• Routers are devices used to route
messages from one network to the Router
other
• Intelligent routing can be performed on
messages by looking at the network
portion of the address AP Network B
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
164.16.82.133
EE250 | Networking Basics | Unit 2 | 35
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 36
IPv4 Packet
• Data from upper layers is encapsulated
into a "packet" then an IP header is Byte0 Byte1 Byte2 Byte3
Header Checksum
Options Padding
dropped
• Source and Dest. IP Address IP Packet Format
– Identify original sender and final
destination
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 37
IP Routing
• Only involves the network layer down
• Destination IP address is examined by routers to find the next hop that
will hopefully get the message closer to the destination
• Data-link (physical) address is changed to the next hop of the route
• Demo: tracert (trace route)
IP: 164.16.82.133
MAC: E
Transport Layers
• Layer 4 Implementations
• Handle end-to-end communication issues
– Multiplexing multiple applications over single network interface (via "ports")
– Reliability
– Reordering
– Flow Control, Congestion Control
• Examples:
– TCP (Transmission Control Protocol)
– UDP (User Datagram Protocol)
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 39
Ports
• Ports allow us to share/multiplex a single network connection
between several applications
• Analogy:
– IP address = Building address (Same for all apartments)
– Port = Separate mailbox for each apartment This Photo by Unknown Author is licensed under CC BY-NC-ND
Host Machine
Network
Routing Network
Single-hop Layer 2:
Delivery Data Link
Signaling of bits Layer 1:
Physical
Communications
Links
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed. Internet Model
EE250 | Networking Basics | Unit 2 |
Ports
Application Port
• Act as endpoints for messages at a destination HTTP 80
– A Web server will "listen" on port 80 HTTPS 443
– A Web browser will create its own port and send a IMAP 143
message to the server at port 80 requesting a page
SSH/SFTP 22
– The listening web server gets the request, processes it,
and returns the page to the source port specified in the Port
Description
message Range
– The web browser will get the page and display it Well-known ports for
common protocols;
• For common protocols (TCP/UDP) port numbers Requires superuser
0-1023
are 16-bits (0 – 65535) privilege to bind to these
ports; Don't use these
– Ports are broken into ranges where some numbers are for your own apps.
dedicated (i.e. http = 80)
New protocols can
– Others are for temporary use 1024-
apply for a port in this
– Windows: netstat -a -b (Run as admin) 49151
range.
49152- Dynamic/Ephemeral
See: https://en.wikipedia.org/wiki/Registered_port
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
65535 ports
EE250 | Networking Basics | Unit 2 | 41
Wireshark Demo
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 42
Learning More
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 |
BACKUP ILLUSTRATIONS
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
EE250 | Networking Basics | Unit 2 | 44
CC BY-NC-ND
CC BY-SA
CC BY-SA
CC BY-SA
CC BY
Author is licensed under
Author is licensed under
Author is licensed under
Author is licensed under
Author is licensed under
• Application and transport layers
generally only run on endpoints / nodes
• Network (IP) layer may inspect packets
Client Server
Access
Application Switch Application
Point (AP)
Transport / Switch Router Router Transport
Network Network Network Network
Data Link DL DL DL DL DL DL DL Data Link
Physical PHY PHY PHY PHY PHY PHY PHY Physical
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
Wireless Ethernet Fiber Ethernet Ethernet
EE250 | Networking Basics | Unit 2 | 45
CC BY-NC-ND
CC BY-SA
CC BY-SA
CC BY-SA
CC BY
Author is licensed under
Author is licensed under
Author is licensed under
Author is licensed under
Author is licensed under
• The original data from the application and transport layer is not
modified during transmission
• The network layer's logical address (final destination) is inspected
Switch
Client Client Router Client Server
APP APP
TRPT TRPT
6 6
NET 1 NET 3 7 NET NET 8 NET 4 NET 6
6
PHY PHY PHY PHY PHY PHY PHY
F PHY
B,G 6
© 2024 by Mark Redekopp and Bhaskar Krishnamachari. This content is protected and may not be shared, uploaded, or distributed.
802.11 Wireless 6 Ethernet
EE250 | Networking Basics | Unit 2 | 46