CAN201 W1

This is the note of CAN201(introduction to networking).

The lecture of W1 is mainly discussing about Internet.

  1. What’s the Internet?
  2. Network edge and core
  3. Network performance
  4. Protocol layers and service models
  5. Network security

这星期主要是对这学期所要学习的内容大致的介绍,由预习笔记改编完成。
The lab of this week is about Python I - IDE and Interpreter.


Lecture

What’s the Internet?

Many forms: application, hardware, ongoing…


How does the Internet work?

People access Internet with Wi-Fi, 4G and so on.
Medium: optical fiber光纤, metal, radio…
Methods:

  • Packet switches 分组交换
  • Protocols协议: TCP/IP, HTTP, 802.11

Framework:

  • Layered(from global to local): ISO/OSI - 7, IP stack - 5
    internet的部件

Protocols协议

Protocols define format, order of messages sent and received among network entities, and actions taken on message transmission, receipt.
协议定义格式,在网络实体之间发送和接收消息的顺序,以及在消息传输和接收时所采取的动作。
Network protocols:

  • Machines rather than humans
  • All communication activity in Internet governed by protocols. 所有互联网上的活动都收到协议的控制。
    计算机网络协议

How to build the Internet world?

Infrastructure 基础设施

  • Communication Channel 沟通渠道
  • Provided by ISP 由ISP提供

Computing Service

  • Servers or Cloud
  • Provided by institutions or Cloud Service Provider 由机构或云服务提供商提供

Applications

  • A variety of applications with nice GUI 应用程序
  • Provided by many companies and developers 公司和开发者

Standards

IETF (Internet Engineering Task Force)
https://www.ietf.org/
This’s their website.


Network edge and core

Network edge = Host: 主机

  • Clients: PCs, Mobile phones, Smart
  • Servers: normally hosted in data centers

Physical media to access networks:

  • Wired or wireless communication links

Network core:

  • Interconnected routers 互联路由器
  • Network of networks

Access networks and physical media

How to connect end systems to edge router? 如何连接终端系统到边缘路由器

  • Residential access nets 住宅
  • Institutional access networks 机构
  • Mobile access networks 移动设备

Keep in mind:

  • Bandwidth (bits per second) of access network? 网络的访问带宽
  • Shared or dedicated? 共享还是专用

Dial-up Internet access

Dial-up Internet access is a form of Internet access that uses the facilities of the public switched telephone network (PSTN) to establish a connection to an Internet service provider (ISP) by dialing a telephone number on a conventional telephone line. Dial-up connections use modems to decode audio signals into data to send to a router or computer, and to encode signals from the latter two devices to send to another modem.
拨号互联网接入是利用公共电话交换网(PSTN)的设施,通过在传统电话线上拨打电话号码,与互联网服务提供商(ISP)建立连接的互联网接入形式。拨号连接使用调制解调器将音频信号解码成数据发送到路由器或计算机,并将后两个设备发出的信号编码发送到另一个调制解调器。
带宽: 56 Kbps


Digital subscriber line

aka DSL 数字用户线
Telephone line based:

  • to central office DSL Access Multiplexer aka DSLAM
  • data over DSL phone line goes to internet
  • voice over DLS phone line goes to telephone net

带宽:

  • Upstream transmission rate < 2.5 Mbps (typically < 1Mbps) 上行传输速率
  • Downstream transmission rate < 24 Mbps (typically < 10Mbps) 下行传输速率
  • ADSL = Asymmetric Digital Subscriber Line 非对称数字用户线路

Access network: cable network (TV net based)

接入网:有线网络(基于电视网络)
key technology: Frequency division multiplexing (FDM) 频分复用

  • Different channels transmitted in different frequency bands 不同的信道在不同的频段传输

HFC: hybrid fiber coax 混合光纤同轴电缆

  • Asymmetric: 30Mbps downstream transmission rate, 2 Mbps upstream transmission rate. 非对称:下行速率为30Mbps,上行速率为2mbps。
    混合光纤同轴接入网

Access network: fiber to the home

光纤到家
fiber to the home


Access network: home network

home network


Enterprise access networks (Ethernet)

以太网(企业用)
Typically used in companies, universities, etc.
10 Mbps, 100Mbps, 1Gbps, 10Gbps transmission rates.
Today, end systems typically connect into Ethernet switch. 终端系统通常连接到以太网交换机。


Wireless access networks

Shared wireless access network connects end system to router ,via base station, aka “access point”. 共享无线接入网将终端系统连接到路由器,通过基站,也就是“接入点”。
wireless access networks


Physical media

twisted pair

two insulated copper wires 双绝缘铜线

  • category 5:100 Mbps, 1 Gbps Ethernet
  • category 6:10 Gbps

coaxial cable

two concentric copper conductors 两根同心铜导线

  • bidirectional 双向
  • broadband: multiple channels on cable 宽带

fiber optic cable

glass fiber carrying light pulses, each pulse a bit 玻璃纤维携带光脉冲,每个脉冲一点

  • high-speed operation: high-speed point-to-point transmission 点对点高速传输
  • low error rate: repeaters spaced for apart, immune to eletromagnetic noise 中继器间隔,不受电磁噪声影响

radio

Signal carried inelectromagnetic spectrum 电磁波谱中携带的信号

  1. No physical “wire”
  2. bidirectional 双向
    Propagation environment effects: 传播环境影响
  • Reflection
  • Obstruction by objects 物体的阻碍
  • Interference! 干扰

Radio link types:

  • Wireless LAN (e.g., WiFi)

    • 54 Mbps – 9.6Gbps
  • Wide-area (e.g., cellular)

    • 4G cellular: ~ 100 Mbps
    • 5G cellular: ~ 1Gbps
  • Satellite

    • Kbps to 45Mbps channel (or multiple smaller channels)
    • Starlink ~ 1440Mbps
    • 270 msec end-end delay

Network Core

  1. Mesh of interconnected routers. 互连路由器的网状结构
  2. Packet-switching: 分组交换
    • Hosts break application-layer messages into small packets. 主机将应用层消息分解成小数据包
    • Packages are forwarded from one router to the next, across links on path from source to destination. 包从一个路由器转发到下一个路由器,在从源到目的地的路径上跨越链接

Two key network-core functions

  1. Routing: determines source- destination route taken by packets (routing algorithms) 路由:确定数据包采取的源-目的路由。
  2. Forwarding: move packets from router’s input to appropriate router output. 转发:将数据包从路由器的输入端移动到相应的路由器输出端。
    two ways

Packet Switching

store-and-forward

store-and-forward

queueing delay, loss

if arrival rate (in bits) to link exceeds transmission rate of link for a period of time: 如果一段时间内到达链路的速率超过了链路的传输速率

  • packets will queue, wait to be transmmitted on link 报文将排队,等待链路传输
  • packets can be dropped (lost) if memory (buffer) fills up 如果内存(缓冲区)被填满,包会被丢失
    queueing delay, loss

Circuit switching

  • dedicated resources专用资源: no sharing

    • circuit-like (guaranteed) performance 电路性能
  • Circuit segment is idle if not used by call (no sharing) 如果没有调用,电路段空闲

  • Commonly used in traditional telephone networks

FDM & TDM

FDM & TDM


Packet VS Circuit

Packet switching allows more users to use network! 分组交换允许更多的用户使用网络。
Is packet switching a “winner?”

  • PS advantages:

    • resource sharing
    • simpler, no call setup
  • PS drawbacks:

    • excessive congestion possible: delay and loss
      • protocols needed for reliable data transfer, congestion control
  • How to provide circuit-like behavior PS?

    • Bandwidth guarantees
    • New methods should be developed

Internet: Network of networks

  • End systems connect to Internet via access ISPs (Internet Service Providers) 终端系统通过接入isp(互联网服务提供商)连接到互联网

    • residential, company and university ISPs
  • Access ISPs in turn must be interconnected. 接入isp也必须相互连接

    • so that any two hosts can send packets to each other
  • Resulting network of networks is very complex

    • evolution was driven by economics and national policies

Q: Given millions of access ISPs, how to connect them to together?
Option 1: connect each access ISP to every other access ISP
A: connecting each access ISP to each other directly doesn’t scale: O(N2) connections. 将每个访问ISP直接连接到彼此并不具有伸缩性:O(N2)连接。

Option 2: connect each access ISP to one global transit ISP
Option 2


Network performance

Package Loss, Delay and Bandwidth

How do loss and delay occur?

Packages queue in router buffers


Four sources of packet delay

four sources

  • dproc: nodal processing 节点处理

    • check bit errors 检查位错
    • determine output link 确定输出环节
    • typically < msec
  • dqueue: queueing delay 队列延迟

    • time waiting at output link for transmission 输出链路等待传输的时间
    • depends on congestion level of router 取决于路由器的拥塞水平
  • dtrans: transmission delay

    • L: packet length (bits)
    • R: link bandwidth (bps)
    • dtrans = L/R
  • dprop: propagation delay:

    • d: length of physical link
    • s: propagation speed (~2.9x10^8 m/sec)
    • dprop = d/s

dtrans and dprop very different.


Queueing delay

queueing delay standard


Packet Loss丢包

  • Queue (aka buffer) preceding link in buffer has finite capacity 队列前的链接在缓冲区有有限的容量
  • Packet arriving to full queue dropped (aka lost) 到达队列满的数据包被丢弃
  • Lost packet may be retransmitted by previous node, by source end system, or not at all 丢失的数据包可以由前一个节点、源端系统重传,或者根本不重传

Throughput吞吐量

Definition: rate (bits/time unit) at which bits transferred between sender/receiver 在发送方/接收方之间传输比特的速率
Two kinds of throughput:

  • instantaneous瞬时: rate at given point in time 给定时间点的速率
  • average平均: rate over longer period of time 较长时期内的比率

服务器传送bits到管道里,管道带着fluid以Rsbits/sec速度运行,穿过buffer之后以Rcbits/sec速度运行,最后到达用户处
Throughput


Internet Scenario

Per-connection end-end throught: min{Rc,Rs,R/10}
In practice: Rc or Rs is often bottleneck.


Protocol layers and service models

Internet protocol stack

五层结构!!!
Internet protocol stack

ISO/OSI reference model

ISO/OSI reference model

Encapsulation封装

Encapsulation
Why layering? 为什么要分层

  1. divide complex systems to simple components 把复杂的系统分割成简单的部分
  2. easy to maintenance 易于维护
  3. flexible for updating 可以灵活的升级

Network security

Q: Field of network security

  1. how bad guys can attack computer networks
  2. how we can defend networks against attacks
  3. how to design architectures that are immune to attacks

Q: Internet not originally designed with (much) security in mind

  1. Original vision: “a group of mutually trusting users attached to a transparent network”
  2. Internet protocol designers playing “catch-up”
  3. Security considerations in all layers

Types

  • Malware恶意软件: virus, worm, spyware 病毒、蠕虫、间谍软件
  • DDoS: Distributed denial of service attack 分布式拒绝服务攻击
  • Packet “sniffing” 包嗅探

Lab

Task:

  1. Install Python and PyCharm
  2. Build a virtual Python runtime environment using Virtualenv
  3. Write a hello world code in a python script file (.py file) in PyCharm
  4. Study variables and print in Python – number / string / list / dict
  5. Study conditionals in Python
  6. Study loops – for and while

这就没必要写了,INT104都学过了。就是打出一个”Hello World”就没有了。

1
2
3
4
5
6
def print_hi(name):
print(f'Hi, {name}')


if __name__ == '__main__':
print_hi('Pycharm')

References

  1. XJTLU MC PowerPoint slides (CAN201 Week1 Lecture1 & Lab1)
  2. 计算机网络 自顶向下方法.原书第6版
作者

Felix Chen

发布于

2021-09-10

更新于

2021-09-29

许可协议

评论