Top Banner

Click here to load reader

of 38

TCP in Mobile Ad Hoc Networks (MANETs)

Jan 23, 2016

Download

Documents

robbin

TCP in Mobile Ad Hoc Networks (MANETs). Wireless Network Lab. TCP 拥塞控制窗口变化的是加法增大、乘法减小 (AIMD) : 较好地保证流之间的公平性,因为一旦丢包,窗口立即减半退避,可以为其他流留有足够的空间,从而保证整个的公平性; 拥塞发生时,窗口乘法减小,可快速解除拥塞。. TCP 拥塞控制策略: 慢启动 (Slow Start) 拥塞避免 (Congestion Avoidance) 超时重传 (RTO) 快速重传 (Fast Retransmit ) 快速恢复 (Fast Recovery) - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • TCP in Mobile Ad Hoc Networks(MANETs)Wireless Network Lab.

  • TCP(AIMD)

  • TCP

    (Slow Start)(Congestion Avoidance)(RTO)(Fast Retransmit )(Fast Recovery)

    (CWND)/(RWND)(SWND) = min(RWND, CWND)

  • TCPAd hoc

    TCP

    ACK()

  • Ad hocWLANAd hocTCPTCPTCPAd hoc

  • (1) collisionhidden terminalbit error ratio

    (2) node mobilityheavy contention

    (3) access medium

  • TCPTCP

    Ad hocTCPTCP

  • Ad Hoc /TCP:

    TCPTCP

    TCP-F( TCPFeedback )ELFNATCP()

  • TCPACK

    (fixed RTO)ACK (Dynamic delay ACK)TCP(TCP DoorTCP Detecting out of order and Response)

  • TCP NS2

  • NS2NSNSns/tcl/libns-deafult.tclNSset

  • NS:

    (1):;at;run(2):namtrace(3):;

    (4):agent

    (5):FTPCBR;agent.

    (6):at(7):

  • ---nodeslinksagents

    simulatornodeSimplex-linkDuplex-link

  • Agents agentsagentsagents agents/typetypeagents

    agents simulatorattach-agentsagents

  • agentagentattach-sourceattach-trafficagent

    #===================================# Agents Definition #===================================set tcp_(0) [$ns_ create-connection TCP $node_(0) TCPSink $node_(1) 0]$tcp_(0) set window_ 32$tcp_(0) set packetSize_ 512set ftp_(0) [$tcp_(0) attach-source FTP]$ns_ at 0.0 "$ftp_(0) start"

  • TCP Agent agent agent

    agent sink

    agent

  • TCP agent Agent/TCP - a tahoe TCP sender Agent/TCP/Reno - a Reno TCP sender Agent/TCP/Newreno - Reno with a modification Agent/TCP/Sack1 - TCP with selective repeat (follows RFC2018) Agent/TCP/Vegas - TCP Vegas Agent/TCP/Fack - Reno TCP with forward acknowledgment

    TCP agent Agent/TCPSink - TCP sink with one ACK per packet Agent/TCPSink/DelAck - TCP sink with configurable delay per ACK Agent/TCPSink/Sack1 - selective ACK sink (follows RFC2018) Agent/TCPSink/Sack1/DelAck - Sack1 with DelAck

  • #TCP RenoFTP

    set tcp1 [new Agent/TCP/Reno]$tcp1 set window_ 24$tcp1 set fid_ 2$ns attach-agent $n2 $tcp1set tcp1sink [new Agent/TCPSink]$ns attach-agent $n3 $tcp1sink$ns connect $tcp1 $tcp1sinkset ftp1 [new Application/FTP]$ftp1 attach-agent $tcp1

  • #TCP VegasFTP $set tcp0 [new Agent/TCP/Vegas] $tcp0 set v_alpha_ 1 $tcp0 set v_beta_ 3 $tcp0 set window_ 24 $tcp0 set fid_ 1 $ns attach-agent $n0 $tcp0 set tcp0sink [new Agent/TCPSink] $ns attach-agent $n1 $tcp0sink $ns connect $tcp0 $tcp0sink set ftp0 [new Application/FTP] $ftp0 attach-agent $tcp0

  • Configuration Parameters

    Agent/TCP set window_ 20 ;# max bound on window sizeAgent/TCP set windowInit_ 1 ;# initial/reset value of cwndAgent/TCP set windowOption_ 1 ;# cong avoid algorithm (1: standard)Agent/TCP set windowConstant_ 4 ;# used only when windowOption != 1Agent/TCP set windowThresh_ 0.002 ;# used in computing averaged windowAgent/TCP set overhead_ 0 ;# !=0 adds random time between sendsAgent/TCP set ecn_ 0 ;# TCP should react to ecn bitAgent/TCP set packetSize_ 1000 ;# packet size used by sender (bytes)Agent/TCP set bugFix_ true ;# see explanationAgent/TCP set slow_start_restart_ true ;# see explanationAgent/TCP set tcpTick_ 0.1 ;# timer granulatiry in sec (.1 is NONSTANDARD)Agent/TCP set maxrto_ 64 ;# bound on RTO (seconds)Agent/TCP set dupacks_ 0 ;# duplicate ACK counterAgent/TCP set ack_ 0 ;# highest ACK received

  • TCP under NS2

    Functions for Sending Data

    Functions for Window Management

    Functions for Processing ACKs

  • send_much (force, reason, maxburst ) maxburst_

    output (seqno, reason) maxseq_TCP

  • Functions for Window Management windowwnd_wnd_advertised

    opencwnd() ACK ACKcwnd_cwnd_

  • closecwnd(int how) ECN how 0 Tahoe TCP TCP ssthresh_1/21 Reno TCP 2 ECN ssthresh_

  • Functions for Processing ACKs recv() ACK ACK ts_peer_ACK timestampECN ACK newack(),ACK seen send_much

  • newack() ACKACK ACKnewtimer()