lecture on mass media society

Upload: mohd-firdaus-abd-latif

Post on 03-Apr-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 Lecture on Mass Media Society

    1/70

    CS211/Fall 2003 9/29

    CS211: Protocol and SystemsDesign for Wireless and MobileNetworks

    Instructor: Songwu [email protected]

    Office: 4531D BH

    Lectures: 2:00-3:50am M&Woffice hours: 4:00-5:00pm M&W

  • 7/29/2019 Lecture on Mass Media Society

    2/70

    CS211/Fall 2003 9/29

    What this course is about...

    Introduce

    Internet design philosophy

    Wireless networking protocols

    Mobile computing system software design

    Trendy topics

    System programming skills

    How to start research

  • 7/29/2019 Lecture on Mass Media Society

    3/70

    CS211/Fall 2003 9/29

    Networking fundamentals: Internet

    philosophy and principles

    Wireless Protocols-MAC protocol-802.11 Standard

    - Scheduling

    - Mobility management, ad-

    hoc routing

    - wireless TCP

    Mobile Computing

    - middleware, OS, file sys.

    - services, applications

    Topical Studies-Wireless security-Sensor networks

    -QoS and Energy-efficient

    design-Mesh Networks

    -MIMO Systems

    A picture of the course coverage

  • 7/29/2019 Lecture on Mass Media Society

    4/70

    CS211/Fall 2003 9/29

    Emerging Wireless Networks

    Base Station

    Fixed Host

    Wireless Cell

    Internet

    Backbone

    Mobile Host

  • 7/29/2019 Lecture on Mass Media Society

    5/70

    CS211/Fall 2003 9/29

    Growth of Wireless Users

    010203040506070

    1991 1993 1995 1997

    Wireless Phone Subscribers (in millions)

    Source: cellular telecom. Indus. Assn.

    02468

    1012

    1997 1998 1999 2000 2001 2002

    Wireless Data Subscriber (in millions)

    Source: Strategis Market Res.

  • 7/29/2019 Lecture on Mass Media Society

    6/70

    CS211/Fall 2003 9/29

    The Wi-Fi Space

    It is one of the fastest growing industrysectors

    100,000 public hotspots by 2005

    Most notebooks will have embedded wi-fi card

    Go and check the local hotspots online www.ezgoal.com/hotspots/

  • 7/29/2019 Lecture on Mass Media Society

    7/70CS211/Fall 2003 9/29

    Protocol Stack Wireless Web, Location

    Services, etc.

    Content adaptation,

    Consistency, File system

    Wireless TCP

    Mobility, RoutingQoS

    o Scheduling

    o MAC

    Application Layer

    Middleware and OS

    Transport Layer

    Network Layer

    Link Layer & Below

  • 7/29/2019 Lecture on Mass Media Society

    8/70CS211/Fall 2003 9/29

    The Course Description

    No required textbook for this course, only aset of papers

    Read and discuss

    your class participation counts

    practice what you have learned get your hand dirty: do a term project

    make your contributions

    Heavy workload expectedYou are expected to be prepared for each lecture

    by reading the paper BEFORE coming to thelecture

  • 7/29/2019 Lecture on Mass Media Society

    9/70CS211/Fall 2003 9/29

    Prerequisites

    basic knowledge of packet switchednetworks & familiarity with TCP/IP

    protocol suite adequate programming experience

    familiar with C/C++/UNIX

    useful reference books: Internetworking with TCP/IP, Vols I, II, III

    by Doug Comer

    TCP/IP Illustrated, Vols 1 & 2 by Stevens

  • 7/29/2019 Lecture on Mass Media Society

    10/70CS211/Fall 2003 9/29

    Course Workload

    One midterm, no final exam Midterm: November 10th, in class.

    reading assignment:

    1~2-page summary for the assigned reading ofeach lecture

    3 strong points, 3 weak points, suggestions

    Similar to the paper review process you are going

    to do for your field in the future all assignments due 12:00pm(noon) before

    lecture on the due date email to [email protected] with subject cs211:

    homework #

  • 7/29/2019 Lecture on Mass Media Society

    11/70CS211/Fall 2003 9/29

    Course Project

    A few big projects

    Several topics within each big project to be

    distributed this Wednesday 2-3 persons on each topic

    Pick a topic and a team by next Monday

    Proposal + Checkpoint + Presentation+ Final Report

  • 7/29/2019 Lecture on Mass Media Society

    12/70CS211/Fall 2003 9/29

    Why such projects?

    Interact closely within your topic team

    Discuss every three weeks within your

    big project to have the big picture inmind

    Stimulate discussions across teams

    Most topics are well defined, and youhave a good starting point

  • 7/29/2019 Lecture on Mass Media Society

    13/70CS211/Fall 2003 9/29

    Grading PolicyGrading breakdown:

    in-class presentation: 10% 5~10 min each person

    Will get an assigned paper (expanding the topicscope of the paper discussed in class) from me

    midterm exam: 30%

    homework assignments: 20% There would be 19 assignments, you are expected

    to turn in at least 15

    The 15 critiques with highest scores to be counted

    term project: 40% proposal 5%, checkpoint 10%, final report 15%,

    presentation & demo 10%

  • 7/29/2019 Lecture on Mass Media Society

    14/70CS211/Fall 2003 9/29

    Course policies

    Homeworks, project proposals & reports alldue 12:00pm on the due date

    No late turn-in accepted for credit!!!

    No makeup exam!!!

    Course homepage:

    http://www.cs.ucla.edu/classes/fall03/cs211/

    [email protected]

    mailto:[email protected]:[email protected]
  • 7/29/2019 Lecture on Mass Media Society

    15/70

    CS211/Fall 2003 9/29

    Tips on Doing Research in Graduate School

    1. How to do productive research in graduate school

    2. What are the bad practices you should avoid

    3. Your feedback?

  • 7/29/2019 Lecture on Mass Media Society

    16/70

    CS211/Fall 2003 9/29

    The content of this presentation

    We take slides and points from many outstandingresearchers: Dave Patterson, Richard Hamming, CraigPatridge, Nitin Vaidya, and the many references andsources cited there. They deserve all the credits

    I also share some of my own experiences

    We need your input and feedback too

  • 7/29/2019 Lecture on Mass Media Society

    17/70

    CS211/Fall 2003 9/29

    Caveats

    Only opinions from some people. Othersmay not agree, including your advisors.

    Use advice at your own risk

    I do not necessarily follow the advice all

    the time This presentation may not follow some

    rules it talks about

  • 7/29/2019 Lecture on Mass Media Society

    18/70

    CS211/Fall 2003 9/29

    What is Research, Anyway?

    Research is not really about coming up with a nice solutionto a hard (possibly new) problem, to show how smart youare.

    It is a process:

    identifying a research problem Coming up with a nice/new result (including simulating,

    implementing, testing your solution)

    Writing your results well

    Presenting your results

    Marketing your work

    Engineering is not science, it is about different tradeoff (whether ucan do things easier, efficient, more convenient, at acceptablecost/complexity), precisely true/false is not the main concern

  • 7/29/2019 Lecture on Mass Media Society

    19/70

    CS211/Fall 2003 9/29

    A Few EQ Rules

    Motivation: you are indeed interested in PhD research

    Think carefully about your career goal when you start your PhD

    NOT: My family asks me to get a PhD, It is hard to find a job with a MSdegree now, I want to hang around in school a little longer

    We can get you interested in something for some time, but not all the time

    Good start: well begun, half done

    Work harder during the first two years to settle down in research

    Have a taste of what is good research; not poisoned by the bad taste

    Believe yourself: your mindset has not be framed by conventionalapproaches yet; you can be innovative since you do not know much

    You have more energy and can have less distraction at this time

    Take the initiative: you do care about what you are working on

    Do not be afraid to talk to your advisor or others, and let people know thenegative results/setbacks etc.

    If u do not talk to these folks, who can u talk to??? disconnected communication causes more confusion among people

    Be honest to research and yourself; do not hide the nasty findings. If you donot understand something, ask; then you will know it.

    The reality of capture effect: Each advisor has more students than (s)he canhandle; whoever is more aggressive gets more feedback more output

    Push for the project schedule from your side: call for meetings, set deadlines

    for internal drafts, look for places where to publish, etc.

  • 7/29/2019 Lecture on Mass Media Society

    20/70

    CS211/Fall 2003 9/29

    EQ Rules (Contd)

    Regular life: manage your time and life properly

    Shift from deadline scheduling to priority scheduling

    Evaluate your progress periodically. No one else will tell youthat you are not efficient

    Have a to-do list on a daily/weekly/monthly basis

    Keep your most productive time-slot during a day to yourself

    No interruption even by your advisor, full concentration

    Even when the deadline comes

  • 7/29/2019 Lecture on Mass Media Society

    21/70

    CS211/Fall 2003 9/29

    How to put yourself into the best position?

    Keep yourself informed and networked: know what is going on

    and talk to people

    Know the literature on the topic you are working on; not let us tellyou what to read. A quick rule 10+10 for breadth and depth: ten topsystems/network conferences and ten leading groups

    People networking: the best way to be a missionary for your work

    Conference is a best place to talk to people. Do not spend most time to

    polish your slides/talk there!! When people contact you for your work, be responsive. If you do not

    care about your work, who should care?

    Attend seminars: people present the meat and dark side of theirwork in a talk

    Balance between quality and quantity: make your recordwithout controversy

    Target a top conference each year: show your work quality

    Try at least a couple of small conferences: show your productivity

    Good way to practice writing, independent research, presentation,

    A nice way to go to scenery places for sightseeing, vacations

  • 7/29/2019 Lecture on Mass Media Society

    22/70

    CS211/Fall 2003 9/29

    Selecting a Problem Solve a real problem that sb. cares about

    Follow the industry technology trend and try to stay ahead

    of it a little Bad move: even if technology appears to leave you behind, stand by

    your problem

    Bad move: avoid payoffs of less than 20 years

    Working on a new problem is always easier

    People have worked on some problems, e.g., congestion control, foryears. It is debatably harder for you to jump in and make majorcontributions

    Select a topic that you are interested for some extendedperiod of time, not just for a month

    Interdisciplinary topics are always better, they can be veryfruitful

    Running real experiments to discover new problems

    For systems topic, start from yourself: what do you need the

    systems to do for you?

    C i ith l ti

  • 7/29/2019 Lecture on Mass Media Society

    23/70

    CS211/Fall 2003 9/29

    Coming up with a solution Do not rush for a solution simply based on the literature or what others tell

    you

    Understand the problem better, the solution naturally follows

    Use common sense Do not try to simply combine several existing solutions

    Explore new approaches: the alternative/opposite first

    Ask questions based on your intuition

    Keep things simple unless a very good reason not to

    Pick innovation points carefully Best results are obvious in retrospectAnyone could have thought of that

    Complexity cost is in longer design, construction, test, and debug

    Fast changing field + delays => less impressive results

    Bad move: best compliment: it is so complicated, I cannot understand

    the ideas Best solutions are a combination of simplicity and depth

    Keep the solution core simple

    Depth is on second-level issues and fixes

    A relevant issue: How do I know mine is different from others

    READING PAPERS

  • 7/29/2019 Lecture on Mass Media Society

    24/70

    CS211/Fall 2003 9/29

    How to read a paper?

    Know why you want to read the paper

    To know whats going on

    title, authors, abstract

    Track a few leading groups/researchers in your area, typicallyless than 10 is enough

    Only a few conferences (and journals): sigcomm, mobicom,infocom, sosp, sigmetrics, mobisys,

    Papers in your broad research area

    introduction, motivation, solution description, summary,

    conclusions

    sometimes reading more details useful, but not always

    Papers that are directly relevant to your work

    read entire paper carefully, and several times

  • 7/29/2019 Lecture on Mass Media Society

    25/70

    CS211/Fall 2003 9/29

    What to note

    Authors and research group

    Need to know where to look for a paper on particular topic

    Theme of the solution Should be able to go back to the paper if you need more info

    Approach to performance evaluation

    Note any shortcomings

    Be critical. It is easy to say nice words about a work, it isharder to identify limitations/flaws

    I th f h

  • 7/29/2019 Lecture on Mass Media Society

    26/70

    CS211/Fall 2003 9/29

    Get Periodic Reviews/Feedbacks with OthersTalk to people and ask what they think

    Give a seminar within your groupperiodically to collect feedback

    Explain the results to your friends, seewhether they can grasp your problem andyour solution

    For both technical people and non-technicalpeople

    Exchange emails, publish technical reports

    In the process of a researchproject

  • 7/29/2019 Lecture on Mass Media Society

    27/70

    CS211/Fall 2003 9/29

    Evaluate Quantitatively If you cant be proven wrong, then you cant prove youre right

    Report in sufficient detail for others to reproduce results

    cant convince others if they cant get same results

    For better or for worse, benchmarks shape a field

    Good ones accelerate progress

    good target for development Bad benchmarks hurt progress

    help real users v. help sales?

    Before you run real experiments, do an intuitive analysis

    Math does not need to be fancy, as long as it proves thepoint; in fact, best theory starts from scratch, not from somecomplex theorem you never heard about

  • 7/29/2019 Lecture on Mass Media Society

    28/70

    CS211/Fall 2003 9/29

    Marketing Publishing papers is not equivalent to marketing

    Missionary work: Sermons first, then they read papersSelecting problem is key: Real stuff

    Ideally, more interest as time passes

    Change minds with believable results

    Dave Pattersons experience: industry is reluctant to embrace

    changeHoward Aiken, circa 1950:

    The problem in this business isnt to keep people from stealingyour ideas; itsmakingthem steal your ideas!

    Need 1 bold company (often not no. 1) to take chance andbe

    successful RISC with Sun, RAID with (Compaq, EMC, )

    Then rest of industry must follow

    Publicize software: when people use your tools, they know yourresults

    think about how ns-2 and its wireless extension evolve

  • 7/29/2019 Lecture on Mass Media Society

    29/70

    CS211/Fall 2003 9/29

    How to write a paper

    Do unto others as you would have them do unto you When you have truly exceptional results

    P == NP

    Probably doesnt matter how you write, people will read

    it anyway Most papers are not that exceptional

    Good writing makes significant difference

    Better to say little clearly, than saying too much

    unclearly

  • 7/29/2019 Lecture on Mass Media Society

    30/70

    CS211/Fall 2003 9/29

    Readability a must

    If the paper is not readable, author has not given writingsufficient thought

    Two kinds of referees

    If I cannot understand the paper, it is the writers fault

    If I cannot understand the paper, I cannot reject it

    Dont take chances. Write the paper well.

    Badly written papers typically do not get read

  • 7/29/2019 Lecture on Mass Media Society

    31/70

    CS211/Fall 2003 9/29

    Do not irritate the reader

    Define notation before use

    No one is impressed anymore by Greek symbols

    If you use much notation, make it easy to find

    summarize most notation in one place

    Avoid Using Too Many Acronyms AUTMA ?!

    You may know the acronyms well. Do not assume

    that the reader does (or cares to)

  • 7/29/2019 Lecture on Mass Media Society

    32/70

    CS211/Fall 2003 9/29

    Writing a draft

    First read Strunk and White, then follow these steps;

    1. 1-page paper outline, with tentative page budget/section

    2. Paragraph map

    1 topic phrase/sentence per paragraph, handdrawn

    figures w. captions

    3. (Re)Write draft

    Long captions/figure can contain details ~ Scientific American

    Uses Tables to contain facts that make dreary prose

    4. Read aloud, spell check & grammar check(MS Word; Under Tools, select Grammar, select Options, select

    technical for writing style vs. standard; select Settings and select)5. Get feedback from friends and critics on draft; go to 3.

    www.cs.berkeley.edu/~pattrsn/talks/writingtips.html

  • 7/29/2019 Lecture on Mass Media Society

    33/70

    CS211/Fall 2003 9/29

    How to write a systems paper

    Provide sufficient information to allow people to reproduceyour results

    people may want to reproduce exciting results

    do not assume this wont happen to your paper

    besides, referees expect the information

    Do not provide wrong information

    Sometimes hard to provide all details in available space

    may be forced to omit some information

    judge what is most essential to the experiments

    cite a tech report for more information

  • 7/29/2019 Lecture on Mass Media Society

    34/70

    CS211/Fall 2003 9/29

    Discuss related work

    Explain how your work relates to state of the art

    Discuss relevant past work by otherpeople too

    Remember, they may be reviewing your paper.

    Avoid: The scheme presented by FOO performs terribly

    Prefer: The scheme by FOO does not perform as well inscenario X as it does in scenario Y

    Avoid offending people, unless you must

  • 7/29/2019 Lecture on Mass Media Society

    35/70

    CS211/Fall 2003 9/29

    Tell them your shortcomings

    If your ideas do not work well in some interesting scenarios,tell the reader

    People appreciate a balanced presentation

  • 7/29/2019 Lecture on Mass Media Society

    36/70

    CS211/Fall 2003 9/29

    How to write weak results

    If results are not that great, come up with better ones

    Do not hide weak results behind bad writing

    Be sure to explain why results are weaker than you expected

    If you must publish: write well, but may have to go to second-

    best conference Only a few conferences in any area are worth publishing in

    Too many papers in poor conferences bad for your reputation

    Just because a conference is IEEE or ACM or Internationaldoes not mean it is any good

    If results not good enough for a decent conference, rethinkyour problem/solution

  • 7/29/2019 Lecture on Mass Media Society

    37/70

    CS211/Fall 2003 9/29

    Miscellaneous

    Read some well-written papers

    award-winning papers from conferences

    Avoid long sentences

    If you have nothing to say, say nothing

    dont feel obliged to fill up space with useless text

    if you must fill all available space, use more line spacing,greater margins, bigger font, bigger figures, anything but drivel

  • 7/29/2019 Lecture on Mass Media Society

    38/70

    CS211/Fall 2003 9/29

    How to present a poster

    Answer Five Heilmeier Questions

    1. What is the problem you are tackling?2. What is the current state-of-the-art?

    3. What is your key make-a-difference concept or technology?

    4. What have you already accomplished?

    5. What is your plan for success?

    Do opposite of Bad Poster commandments Poster tries to catch the eye of person walking by

    9 page poster might look like

    ProblemStatement

    State-of-the-Art

    KeyConcept

    Accomplish-ment # 1

    Title andVisual logo

    Accomplish-ment # 2

    Accomplish

    -ment # 3

    Plan for

    Success

    Summary &

    Conclusion

  • 7/29/2019 Lecture on Mass Media Society

    39/70

    CS211/Fall 2003 9/29

    How to present a paper(at a conference)

    Objectives, in decreasing order of importance Keep people awake and attentive

    everything has been tried: play fiddle, cartoons, jokes

    in most cases, extreme measures should not be needed

    humor can help

    Get the problem definition across

    people in audience may not be working on your problem

    Explain your general approach

    most productive use of your time

    Dirty details

    most people in the audience probably do not carea typical conference includes 30+ paper presentations,

    yours could be the N-th

  • 7/29/2019 Lecture on Mass Media Society

    40/70

    CS211/Fall 2003 9/29

    How many slides?

    Depends on personal style

    Rules of thumb

    1 slides for 1-2 minutes Know your pace

    I tend to make more slides than I might need, and skip thenot-so-important ones dynamically

    Anticipate technical questions, and prepare explanatoryslides

  • 7/29/2019 Lecture on Mass Media Society

    41/70

    CS211/Fall 2003 9/29

    How to present a paper

    Practice makes perfect (or tolerable)

    May need several trials to fit your talk to available time

    particularly if you are not an experienced speaker

    English issue

    Accent may not be easy to understand

    Talk slowlyEasier said than done

    I have a tough time slowing down myself

  • 7/29/2019 Lecture on Mass Media Society

    42/70

    CS211/Fall 2003 9/29

    The rest of the notes

    Overview/Review:

    Internet protocol stack

    IP protocol

    TCP protocol

    If you forget these materials, go back andreview what you learned in CS118 ASAP

  • 7/29/2019 Lecture on Mass Media Society

    43/70

    CS211/Fall 2003 9/29

    Packet Switched Networks

    Hosts send data in packets network supports all data communication

    services by delivering packets

    Web, email, multimedia

    Host Host

    Application

    Host

    Web

    Host Host

    video

    email

  • 7/29/2019 Lecture on Mass Media Society

    44/70

    CS211/Fall 2003 9/29

    One network application example

    [email protected] [email protected]

    msg

  • 7/29/2019 Lecture on Mass Media Society

    45/70

    CS211/Fall 2003 9/29

    What is happening inside ?

    [email protected] [email protected]

    Physical net physical netPhysical net

    Network

    protocol

    Network

    protocol

    Network

    protocol

    Network

    protocol

    Transport

    protocol

    Transport

    protocol

  • 7/29/2019 Lecture on Mass Media Society

    46/70

    CS211/Fall 2003 9/29

    A B C

    network topology

    Layered Network Architecture

    network consists of geographicallydistributed hosts and switches (nodes)

    Nodes communicate with each other by

    standard protocols

    B

    A C

    physical connectivity

    Protocol layers

    D

    host switch

  • 7/29/2019 Lecture on Mass Media Society

    47/70

    CS211/Fall 2003 9/29

    Ethernet frame

    network packet

    Transport segment

    header tail

    header

    header

    DATA

    DATA

    data

    Whats in the header: info needed for the protocols function

    Application (data)

    B

    A

    physical connectivity

    a picture of protocol layers

  • 7/29/2019 Lecture on Mass Media Society

    48/70

    CS211/Fall 2003 9/29

    TCP/IP Protocol Suite

    IP Protocol: Inter-networking protocol

    RFC791

    TCP Protocol: reliable transport protocol RFC793

  • 7/29/2019 Lecture on Mass Media Society

    49/70

    CS211/Fall 2003 9/29

    Why IP

    a number of different networktechnologies developed in early 70s:

    ARPAnet, Ethernet, Satnet, PRnet

    different trans. media: copper, radio,satellite

    different protocol designs, e.g.

    ARPAnet: reliable message delivery Ethernet: unreliable packet delivery

    under different administrative control

  • 7/29/2019 Lecture on Mass Media Society

    50/70

    CS211/Fall 2003 9/29

    Fundamental Goal of IP

    developing an effective technique formultiplexed utilization of all existing

    networks no centralized control

    no changes to individual subnets

    To read next timeThe Design Philosophy of Internet Protocols

    by Dave Clark, SIGCOMM'88

  • 7/29/2019 Lecture on Mass Media Society

    51/70

    CS211/Fall 2003 9/29

    transport

    (end-to-end)

    subnets

    ethernet token-ring FDDI dialup ATM

    IP

    TCP UDP

    inter-network layer

    application protocols

    transport layer protocols

    universal datagram delivery

    hardware-specific

    network technologies

    The picture of the world

    according to IP

  • 7/29/2019 Lecture on Mass Media Society

    52/70

    CS211/Fall 2003 9/29

    IP Packet Header Formatvers. IHL Type-of-Service total length

    identifier fragment offset

    time-to-live protocol checksum

    source address

    destination address

    options (variable length) padding

    data

    DFMF

  • 7/29/2019 Lecture on Mass Media Society

    53/70

    CS211/Fall 2003 9/29

    IP: two basic functions

    a globally unique address for eachreachable interface

    datagram delivery from any host to any

    other host(s)

    two supporting protocols

    ICMP (Internet Control Message Protocol)

    ARP (Address Resolution Protocol)

  • 7/29/2019 Lecture on Mass Media Society

    54/70

    CS211/Fall 2003 9/29

    Fundamental challenge: How to

    scale better Original design: two levels of hierarchy,

    network, host

    Observed problems: class-based address assignment infeasible

    too many networks visible at the top level

    two approaches: subnetting & (CIDR)supernetting

  • 7/29/2019 Lecture on Mass Media Society

    55/70

    CS211/Fall 2003 9/29

    Longer-Term Scaling issues

    We've run out of all IPv4 unicast space far before theoretical limit of 4 billion hosts, due to

    inevitable inefficiency of address block allocation

    Short term patch: NAT boxes

    One long term solution: IP version 6 expanded addressing capability: 16 bytes

    cleanup of IPv4 design after 15 years of runningexperience

    improved support for options/extensions

  • 7/29/2019 Lecture on Mass Media Society

    56/70

    CS211/Fall 2003 9/29

    The IPv6 Header

    Destination Address

    Version Priority Flow Label

    Payload Length Next Header Hop Limit

    Source Address

    32 bits

  • 7/29/2019 Lecture on Mass Media Society

    57/70

    CS211/Fall 2003 9/29

    The IPv4 Header

    shaded fields are absent from IPv6 header

    Version Hdr Len Total Length

    Identification Fragment Offset

    Prec TOS

    Time to Live Protocol Header Checksum

    Flags

    Source Address

    Destination Address

    PaddingOptions

    32 bits

    TCP T i i C l P l

  • 7/29/2019 Lecture on Mass Media Society

    58/70

    CS211/Fall 2003 9/29

    TCP: Transmission Control Protocol

    a transport protocol IP delivers packets from door to door TCP provides full-duplex, reliablebyte-stream

    delivery between two application processes

    Application process

    Write

    bytes

    TCP

    Send buffer

    Application process

    Read

    bytes

    TCP

    Receive buffer

    segment segment

    More terminology:TCP segment

    Max. segmentsize (MSS)

    TCP j f i li i

  • 7/29/2019 Lecture on Mass Media Society

    59/70

    CS211/Fall 2003 9/29

    TCP: major functionalities Header format Connection Management

    Open, close State management

    Reliability management Flow and Congestion control

    Flow control: Do not flood the receivers buffer Congestion control: Do not stress the network by

    sending too much too fast

    f

  • 7/29/2019 Lecture on Mass Media Society

    60/70

    CS211/Fall 2003 9/29

    u a p r s fr c s s y ig k h t n n

    source port destination port

    Data sequence number

    acknowledgment number

    Hlen unused window size

    checksum urgent pointer

    Options (viable length)

    0 16 31

    TCP header format

    data

    IP header

    i ti

  • 7/29/2019 Lecture on Mass Media Society

    61/70

    CS211/Fall 2003 9/29

    client

    server

    open request(x)

    Passive open

    ack(x+1) + request(y)

    ack(y+1)

    (now in estab. state)enter estab. state

    opening a connection:three-way hand-shake

    Cl i TCP C ti

  • 7/29/2019 Lecture on Mass Media Society

    62/70

    CS211/Fall 2003 9/29

    Done, delete conn. state

    Closing a TCP Connection

    I-finished(M)

    I-finished(N)

    ACK (M+1)

    ack(N+1)

    wait for 2MSLbefore deleting

    the conn state

    Mechanisms for Reliability

  • 7/29/2019 Lecture on Mass Media Society

    63/70

    CS211/Fall 2003 9/29

    Mechanisms for ReliabilityManagement

    Sequence number

    Acknowledgment number

    Error detection at the receiver side Retransmission timeout

  • 7/29/2019 Lecture on Mass Media Society

    64/70

    CS211/Fall 2003 9/29

    TCP Flow and Congestion Control Window-based protocol

    Flow control is easy: set the senderswindow no larger than the advertisedwindow by the receiver

    4 algorithms in TCP congestion control

    Control congestion window variable: cwnd

    slow start, congestion avoidance, fast

    retransmit and fast recovery, retransmissionupon timeout

    Sender_window=min(adv_win, cwnd)

  • 7/29/2019 Lecture on Mass Media Society

    65/70

    CS211/Fall 2003 9/29

    Slow Start & Congestion Avoidance

    start conservatively: cwnd

  • 7/29/2019 Lecture on Mass Media Society

    66/70

    CS211/Fall 2003 9/29

    Fast Retransmit

    When the 3rd DUP_ACK is received,ssthresh=max(FlightSize/2, 2*SMSS)

    ReXmit the lost segment, setcwnd=ssthresh+3*SMSS

    Design questions:

    why FlightSize, not cwnd ?FlightSize: data sent but not yet acked

    Why add 3 SMSS to cwnd ?

  • 7/29/2019 Lecture on Mass Media Society

    67/70

    CS211/Fall 2003 9/29

    Fast Recovery

    For each additional DUP_ACK:

    cwnd+=SMSS; (why ?)

    transmit a new segment if min(cwnd, rwnd)

    permits

    When a NEW ACK arrives,

    cwnd=ssthresh; (why ?)

    Retransmission Timeout

  • 7/29/2019 Lecture on Mass Media Society

    68/70

    CS211/Fall 2003 9/29

    Retransmission Timeout

    Initial design:

    RTT=*old_RTT+ (1-)*New_RTT_sample RTO= *RTT; = 2 for original spec

    variation in RTT: ~1/(1-L); factor 4, for L=50%;factor 10, for L=80%; load

  • 7/29/2019 Lecture on Mass Media Society

    69/70

    CS211/Fall 2003 9/29

    Karn s Algorithm

    how to measure RTT in retransmission

    cases? take the delay between the first (last)

    transmission and final ack?

    do not update SRTT in case of retransmission? Karns algorithm:

    do not take RTT samples in case of

    retransmission double the retransmission timer for next

    packet, till one can get a RTT sample withoutretransmission

  • 7/29/2019 Lecture on Mass Media Society

    70/70

    Putting all together: RFC2581

    how TCP congestion control works

    Start with slow startfor bootstrapping phase:quickly open up the window

    At ssthresh, switch to congestion avoidance When 3rd duplicate ACK is received (indicating

    a packet loss), use fast retransmit; if morethan 3 duplicate ACKs, use fast recovery

    Upon retransmission timeout (indicating apacket loss too): cwnd=1, binary exponentialbackoff