第三章 习题课
- 格式:ppt
- 大小:2.26 MB
- 文档页数:52
第三章1、110KV 线路等值电路如图所示,已知末端电压为112KV ,末端功率s2~=4+j 4 (MV A), 线路阻抗Z=2+j4(Ω)。
求始端电压和始端功率,并作出电压向量图。
1U2U解:设2U与实轴重合,则: Z U S U U *⎪⎪⎭⎫ ⎝⎛+=2221~ )42(11244112j j +-+= )112816()112168112(-+++=j 0714.0)214.0112(j ++=0714.0214.112j +=U 1=()220714.0214.0112++=310098.512592-⨯+ =112.2KV214.01120714.01+=-tg δ=O 036.0Z S ~∆=222~⎪⎪⎭⎫ ⎝⎛U S Z =R U Q P 222222++X U Q P j 222222+411244211244222222⨯++⨯+=j MVA j 0102.00051.0+=MVA j j j S S S Z 0102.40051.40102.04)0051.04(~~21+=+++=∆+=电压向量图如图所示:2、 如图3-1线路,负荷由发电厂母线经110kV 单回线路供电,线路长80kM ,型号为LGJ —95,线间几何均距5M .发电厂母线电压U 1=116kV ,受端负荷L S ~=15+j10MV A 求出输出线路的功率损耗及受端电压U 2。
U U LS ~解:对线路LGJ —95有:km r /33.01Ω= km X /429.01Ω=S /km 102.65b -61⨯=)(4.268033.0Ω=⨯=R ,)(32.3480429.0Ω=⨯=XS B 461012.2801065.2--⨯=⨯⨯=,S B 41006.121-⨯= 等值电路如图所示第一步由末端向首端推算功率,设全网电压为额定电压kv U N 11000=∠ 末端导纳支路:MVA j S j B jU S Y 283.11006.11102/~42222-=⨯⨯-=-=∆- 阻抗末端功率 M V A j j j S S S y 717.815283.11015~~~22'2+=-+=∆+=∆ 阻抗的功率损耗)(~22222jX R U Q P S NZ +''=∆+)32.344.26(110717.815222j ++=MVA j 854.0657.0+= 阻抗首端功率为S ~S ~S ~z21'''∆+==15+j8.717+0.657+j0.854=15.657+j9.571 MV A首端功率为=S ~1SS ~Y11∆+'=15.657+j9.571-j1.283=15.657+j8.288MV A第二步用求得的=S ~1和已知的U 1,由首端向末端推算电压。
第三章 微分中值定理习题课一、判断题(每题3分)1.函数)(x f 在0x 点处可导,且在0x 点处取得极值,那么0)(0='x f .( √ )2.函数)(x f 在0x 点处可导,且0)(0='x f ,那么)(x f 在0x 点处取得极值.( × )3.若0x 是()f x 的极值点,则0x 是()f x 的驻点. ( × )4.函数()x f 在区间()b a ,内的极大值一定大于极小值 . ( × )5.若()0,(,)f x x a b ''>∈,则()f x '在(,)a b 内单调增加 .( √ )6.0()0f x '=且0()0f x ''<是函数()y f x =在0x 处取得极大值的充要条件. ( × )7.函数()arctan f x x x =的图形没有拐点. ( √ )8.因为函数y =0x =点不可导,所以()0,0点不是曲线y =.( × )二、选择题(每题3分)1.下列函数中,在闭区间[-1,1]上满足罗尔定理条件的是( D ). A .xe B .ln x C .x D .21x - 2.对于函数()211f x x=+,满足罗尔定理全部条件的区间是( D ). (A )[]2,0-;(B )[]0,1;(C );[]1,2-(D )[]2,2-3. 设函数()()()12sin f x x x x =--,则方程()0f x '=在 (0,)π内根的个数( D )(A) 0个 ; (B)至多1个; (C) 2个; (D)至少3个.4.已知函数3()2f x x x =+在区间[0,1]上满足拉格朗日中值定理的条件,使得该定理成立的ξ=( D ).(A )13 (B (C )12 (D 5.若函数)(),(x g x f 在区间),(b a 上的导函数相等,则该两函数在),(b a 上( C ). A.不相等 B .相等 C.至多相差一个常数 D.均为常数6.arcsin y x x =- 在定义域内( B ).A. 单调减函数B.单调增函数C. 有单调增区间也有单调减区间D. 没有单调性7. 函数2129223-+-=x x x y 的单调减少区间是 ( C ). (A )),(+∞-∞ (B ))1,(-∞(C ))2,1((D )),2(+∞8.设(),a b 内()0f x ''>,则曲线()y f x =在(),a b 内的曲线弧位于其上任一条切线的( A ). (A )上方;(B )下方; (C )左方; (D )右方.9.曲线32y ax bx =+的拐点为(1,3),则 ( A ). (A )3,30a b a b +=+= (B )0,30a b a b +=+= (C )2,320a b a b +=+=(D )0,340a b a b +<+=10. 设函数()y f x =在开区间(,)a b 内有()'0f x <且()"0f x <,则()y f x =在(,)a b 内( C )A.单调增加,图像是凹的B.单调减少,图像是凹的C.单调减少,图像是凸的D. 单调增加,图像是凸的11.函数2y ax c =+在区间()0,+∞内单调增加,则a 和c 应满足( C ).(A )0a <且0c =; (B )0a >且c 是任意实数; (C )0a <且0c ≠;(D )0a <且c 是任意实数.12. 函数23++=x x y 在其定义域内( B ) (A )单调减少 (B) 单调增加 (C) 图形是凹的(D) 图形是凸的13.若()()00,x f x 为连续曲线()y f x =上凹弧与凸弧的分界点,则( A ). (A )()()00,x f x 必为曲线的拐点; (B )()()00,x f x 必为曲线的驻点; (C )0x 点必为曲线的极值点;(D )0x x =必为曲线的拐点.14.函数()2ln f x x x =-的驻点是( B ).(A )1x = (B )12x =(C )(1,2) (D) 1(,1ln 2)2+15.函数2ln(1)y x x =-+的极值( D ). A .是1ln 2-- B .是0D.不存在 C.是1ln216.设()[0,1]()f x x f x ''=在上有<0,则下述正确的是( A )( A ) (1)f '<)0()1(f f -<(0)f '; ( B ) (0)f '<)0()1(f f -<(1)f '; ( C ) (1)f '<(0)f '<)0()1(f f -; ( D ) (0)f '<(1)f '<)0()1(f f -17.设()f x 具有二阶连续的导数,且20()lim3,ln(1)x f x x →=-+则(0)f 是()f x 的( A )(A )极大值; (B )极小值; (C )驻点; (D )拐点.18.设函数()y f x =在0x x =处有()0f x '=0,在1x x =处导数不存在,则( C ). A. 0x x =,1x x =一定都是极值点 B.只有0x x =可以是极值点C. 0x x =, 1x x =都可能不是极值点D. 0x x =,1x x =至少有一个是极值点三、解答题(求极限每题4分其余每题 8分) 1.求极限220000011sin sin 1cos 2(1)lim lim lim lim lim 0sin sin 22→→→→→---⎛⎫-===== ⎪⎝⎭x x x x x x x x x x x x x x x x x x (2)11lim 1ln x xx x →⎛⎫⎪⎝⎭-- =()()11ln 1ln 11limlim 11ln ln x x x x x x x x x x x→→--+-=--+11ln ln 11limlim ln 1ln 22x x x x x x x x x →→+===+-+0(3)11lim 1→⎛⎫ ⎪⎝⎭--x x x e 01lim (1)→--=-xx x e x x e 0011lim lim 12xxx x x x x x x e e e xe e e xe →→-===-+++ (4)200011ln(1)ln(1)lim()lim lim ln(1)ln(1)x x x x x x x x x x x x →→→-+-+-==++0011111limlim lim 22(1)2(1)2x x x x x x x x x →→→-+====++20sin (5)limtan →-x x xx x 2200sin 1cos lim limtan 3x x x x x x x x →→--==0sin 1lim 66x x x →==222201(6)lim(1)→---x x x e xx e 22401lim→--=x x e xx 2232002211lim lim 42x x x x xe x e x x →→--==12=2223220000tan tan sec 1tan 1(7)lim lim lim lim ln(1)333→→→→---====+x x x x x x x x x x x x x x x1ln 1(8)lim cot →+∞⎛⎫+ ⎪⎝⎭x x arc x 1lim cot →+∞=x x arc x 222211lim lim 111x x x x x x x →+∞→+∞-+===+-+sin sin cos (9)limlim cos 1→→-==-x a x a x a xa x a22200021sec 77ln tan 7tan 2sec 77tan 7(10)lim lim lim 11ln tan 2tan 7sec 22sec 22tan 2+++→→→⋅⋅⋅===⋅⋅⋅x x x x x x x x x x x x x(11)lim arctan 2→+∞⎛⎫- ⎪⎝⎭x x x π22221arctan 12lim limlim 1111→+∞→+∞→+∞--+====+-x x x x x x x xxπ2lim ln(arctan )2(12)lim arctan →+∞→+∞⎛⎫= ⎪⎝⎭x xx x x x e ππ2lim ln(arctan )→+∞x x x π222211ln arctan lnln arctan arctan 1limlimlim 111→+∞→+∞→+∞+⋅+===-x x x x x x x xxxππ2222lim 1x x x ππ→+∞=-=-+ 22lim arctan -→+∞⎛⎫∴= ⎪⎝⎭xx x e ππ .()tan 21(13)lim 2→-x x x π解:()()()11sin ln 22limlim tan ln 2cos tan 2221lim 2x x x x x x xx x x eeππππ→→--→-==1122sinlim22x xx e eπππ→---⋅==tan 0(14)1lim +→⎛⎫⎪⎝⎭xx x 0011lim tan lnlim ln++→→⋅⋅==x x x x xxee2001110ln limlim1x x x xx xe ee++→→---====2. 验证罗尔中值定理对函数32452y x x x =-+-在区间[]0,1上的正确性.解:()f x 在闭区间[]0,1上连续,在开区间()0,1内可导,()()012f f ==-满足罗尔定理条件.(3分)令()2121010f x x x '=-+=,得()0,1x =,满足罗尔定理结论.3. 试证明对函数2y px qx r =++应用拉格朗日中值定理时所求得的点ξ总是位于区间的正中间.证明:在区间[],a b 上,()()()f b f a f b aξ-'=- 代入:()()222pb qb r pa qa r p q b aξ++-++=+-解得:2a bξ+=. 4. 证明方程531xx -=在()1,2之间有且仅有一个实根.证明:令()531f x x x =--,()11310f =--<, ()522610f =-->所以 ()0f x =在()1,2上至少一个根,又()4'53f x x =-,当()1,2x ∈时()'0f x >,所以单增,因此在()1,2上至多有一个根.()0f x =在()1,2上有且仅有一个根.5. 设()f x 在[,]a b 上连续,在(,)a b 内可导,且()()0f a f b ==,证明:至少存在一个(,)a b ξ∈,使得()()0f f ξξ'+=. 提示:令()()x F x e f x =证明:令()()xF x e f x =,显然()F x 在[,]a b 上连续,在(,)a b 内可导, 且()()()()x F x e f x f x ''=+ (3分)由Larange 中值定理,则至少(,)a b ξ∈,使得()()()F b F a F b aξ-'=-又()()0f a f b == ∴()()0f f ξξ'+=6. 设()f x 在[0,]a 上连续,在(0,)a 内可导,且()0f a =,证明存在一点(0,)a ξ∈,使得()()0f f ξξξ'+=.提示:令 ()()F x xf x =.证明:构造辅助函数()()F x xf x =, ()f x 在[0,]a 上连续,在(0,)a内可导∴()F x 在[0,]a 上连续,在(0,)a 内可导,()()()F x f x xf x ''=+且(0)()0F F a ==由Rolle 定理,至少(0,)a ξ∃∈,有()0F ξ'= 即()()0f f ξξξ'+=7. 证明:不论b 取何值,方程033=+-b x x 在区间[]1,1-上至多有一个实根证:令()()()()323,33311f x x x b f x x x x '=-+=-=+-()1,1x ∈-时,0,,f f'<故()f x 在区间[]1,1-上至多有一个实根.8. 证明:当1x >时,xe x e >⋅.证明: 令()xf x e x e =-⋅,显然()f x 在[1,]x 上满足Lagrange 中值定理的条ξ∈,使得件,由中值定理,至少存在一点(1,)x()(1)(1)()(1)()f x f x f x e e ξξ'-=-=--即()(1)0f x f >=又即x e x e >⋅9. 证明:当0x >时,112x +>证:()()111022f x x f x '=+==>()()00f x f >=,即有112x +>10. 求证:1,(0,)>+∈+∞xex x证明:令()1,,[0,)xf x e x x =--∈+∞当(0,)x ∈+∞时,()10x f x e '=->故在区间[0,)+∞上,()f x 单调递增从而当(0,)x ∈+∞时,()(0)0f x f >=即1x e x >+或者:证明:()221112!2xf e e x x x x x ξξ''=++=++>+……8分11. 当1>x 时,证明:13>-x. 答案参看课本p148 例6 12. 证明:当0x >时, ln(1).1xx x x<+<+ 答案参看课本P132 例1 13. 设0,1a b n >>>, 证明:11()()n n n n nba b a b na a b ---<-<-.证明:令()nf x x =,显然()f x 在[,]b a 上满足lagrange 定理条件,故至少存在一点(,)b a ξ∈,使得()()()()f a f b f a b ξ'-=- 即1()n n n a b n a b ξ--=-又由b a ξ<<及1(1)n n n ξ->的单增性,得11()()n n n n nba b a b na a b ---<-<-14. 设0a b >>,证明:ln a b b a ba a b--<< 证明:令()ln f x x =,在区间[],b a 上连续,在区间(,)b a 内可导,有拉格朗日中值定理,至少存在一点(),b a ξ∈,使得1ln ln ()a b a b ξ-=-,又因为1110,a b ξ<<<因此,ln a b a a ba b b--<<. 15. 证明恒等式()arcsin arccos ,112x x x π+=-≤≤.证:令()arcsin arccos f x x x =+ 则()f x 在[]1,1-上连续.在()1,1-内有:()0,f x f C '=≡≡令0,,arcsin arccos 22x C x x ππ==+=在()1,1-内成立.再根据()f x 在[]1,1-上的连续性,可知上式在[]1,1-上成立.16. 求函数2y x =的极值点和单调区间. 解:132(1)y x-'=-因此,2y x =在定义域(,)-∞+∞内有不可导点10x =和驻点21x =17. 求函数32535y x x x =-++的单调区间,拐点及凹或凸的区间. 解:23103y x x '=-+,易得函数的单调递增区间为1(,)(3,)3-∞+∞,单调减区间1(,3)3.610y x ''=-,令0y ''=,得53x =. 当53x -∞<<时,0y ''<,因此曲线在5(,]3-∞上是凸的;当53x <<+∞时,0y ''>,因此曲线在5[,)3+∞上是凹的,故520(,)327是拐点18. 试确定,,a b c 的值,使曲线32y x ax bx c =-++在(1,1-)为一拐点,在0x =处有极值,并求曲线的凹凸区间.解:232y x ax b '=-+ 62y x a ''=-(1,1)-为拐点,则062a =- 3a ∴=由0y '=,则2360x x b -+= , 代入0x =,则0b =.11,1a b c c -++=-=曲线为3231y x x =-+, 66y x ''=-. 凸区间为(,1)-∞-, 凹区间为(1,)+∞.19. 求函数()7ln 124-=x x y 的单调区间,拐点及凹或凸的区间.解: 34314(12ln 7)124(12ln 4)y x x x x x x'=-+⋅⋅=-, 易得函数的单调递增区间为13(,)e +∞,单调减区间13(0,)e . ()232112(12ln 4)412144ln 0y x x x x x x x''=-+⋅⋅=>, 令0y ''=,得1x =.当01x <<时,0y ''<,因此曲线在(0,1]上是凸的;当1x <<+∞时,0y ''>,因此曲线在[1,)+∞上是凹的,故(1,7)-是拐点 20. 求函数arctan xy e=的单调区间,拐点及凹或凸的区间.解:arctan 211x y e x '=⋅+>0,因此单调增区间是R , arctan arctan arctan 2222221212(1)(1)(1)xx x x x y e e e x x x ⎡⎤⎡⎤-''=+-=⎢⎥⎢⎥+++⎣⎦⎣⎦, 令0y ''=,得12x =. 当12x -∞<<时,0y ''>,因此曲线在1(,]2-∞上是凹的; 当12x <<+∞时,0y ''<,因此曲线在1[,)2+∞上是凸的,故1arctan 21(,)2e是拐点 21. 求函数1234+-=x x y 的拐点和凹凸区间. 解:3246y x x '=- 2121212(1)y x x x x ''=-=- 令0y ''=,得10x =,21x = 列表 (4分)22. 求函数32391=+-+y x x x 的极值.解:2'3693(1)(3)y x x x x =+-=-+ ''66y x =+ 令0'=y 得驻点:121,3x x ==-.当21x =时,''0,y >取得极小值,其值为4-. 当33x =-时,''0y <,取得极大值,其值为28.23. 求函数23(1)1=-+y x 的极值.解: 226(1)y x x '=-22226(1)24(1)y x x x ''=-+-令0y '=,得1231,0,1x x x =-==(0)60y ''=>,故20x =是极小值点.(1)0y ''±=, 无法用第二充分条件进行判定.在11x =-的附近的左右两侧取值均有0y '<,故11x =-不是极值点. 在21x =的附近的左右两侧取值均有0y '>,故21x =不是极值点. 极小值(0)0y =24. 求函数32(1)(23)=-+y x x 的极值点和单调区间.解:22323(1)(23)4(1)(23)(1)(23)(105)0y x x x x x x x '=-++-+=-++=所以,驻点11x =,232x =-,312x =- 列表∴()f x 在32x =-处取得极大值3()02f -= ()f x 在12x =-处取得极小值127()22f -=- 单调递增区间31(,],[,)22-∞--+∞,单调递增区间31[,]22-- 25. 试问a 为何值时,函数1()sin sin 23=+f x a x x 在3π处取得极值?它是极大值还是极小值?并求此极值.解:2()cos cos23f x a x x '=+()f x在3π处取得极值22121()coscos 03333232f a a πππ'∴=+=⋅-⋅= 23a ∴=即 ()2()cos cos 23f x x x '=+ ()2()sin 2sin 23f x x x ''∴=--222()sin 2sin 2033333f πππ⎛⎫''∴=--=-⋅+< ⎪⎝⎭⎝⎭所以它是极大值,极大值为212()sin sin 33333f πππ∴=+=26. 求函数3223y x x =-在区间[]1,4上的最大值与最小值.解:212660,0,1y x x x x '=-===(舍去x =)()()11,480,f f =-=,故最大值为80,最小值为-1.27.、某车间靠墙壁要盖一间长方形小屋,现有存砖只够砌20m 长的墙壁.问应围成怎样的长方形才能使这间小屋的面积最大?解:设小屋长 x m ,宽 y m ,220,102xx y y +==-.2101022x x S x x ⎛⎫=-=- ⎪⎝⎭,100,10S x x '=-==故小屋长10米,宽5米时,面积最大.28.某厂每批生产产品x 单位的总费用为()5200C x x =+(元), 得到的收入是()2100.01R x x x =-(元).问每批生产多少个单位产品时总利润()L x 最大?解:()()()22100.0152000.015200L x x x x x x =--+=-+-()0.0250,250L x x x '=-+==(单位)()0.020L x ''=-<,故250x =单位时总利润最大.-----精心整理,希望对您有所帮助!。
第三章1. (Q1) Suppose the network layer provides the following service. The network layer in the source host accepts a segment of maximum size 1,200 bytes and a destination host address from the transport layer. The network layer then guarantees to deliver the segment to the transport layer at the destination host. Suppose many network application processes can be running at the destination host.a. Design the simplest possible transport-layer protocol that will get application data to thedesired process at the destination host. Assume the operating system in the destination host has assigned a 4-byte port number to each running application process.b. Modify this protocol so that it provides a “return address” to the destination process.c. In your protocols, does the transport layer “have to do anything” in the core of the computernetwork.Answer:a. Call this protocol Simple Transport Protocol (STP). At the sender side, STP accepts from thesending process a chunk of data not exceeding 1196 bytes, a destination host address, and a destination port number. STP adds a four-byte header to each chunk and puts the port number of the destination process in this header. STP then gives the destination host address and the resulting segment to the network layer. The network layer delivers the segment to STP at the destination host. STP then examines the port number in the segment, extracts the data from the segment, and passes the data to the process identified by the port number.b. The segment now has two header fields: a source port field and destination port field. At thesender side, STP accepts a chunk of data not exceeding 1192 bytes, a destination host address,a source port number, and a destination port number. STP creates a segment which contains theapplication data, source port number, and destination port number. It then gives the segment and the destination host address to the network layer. After receiving the segment, STP at the receiving host gives the application process the application data and the source port number.c. No, the transport layer does not have to do anything in the core; the transport layer “lives” inthe end systems.2. (Q2) Consider a planet where everyone belongs to a family of six, every family lives in its own house, each house has a unique address, and each person in a given house has a unique name. Suppose this planet has a mail service that delivers letters form source house to destination house. The mail service requires that (i) the letter be in an envelope and that (ii) the address of the destination house (and nothing more ) be clearly written on the envelope. Suppose each family has a delegate family member who collects and distributes letters for the other family members. The letters do not necessarily provide any indication of the recipients of the letters.a. Using the solution to Problem Q1 above as inspiration, describe a protocol that thedelegates can use to deliver letters from a sending family member to a receiving family member.b. In your protocol, does the mail service ever have to open the envelope and examine theletter in order to provide its service.Answer:a.For sending a letter, the family member is required to give the delegate the letter itself, theaddress of the destination house, and the name of the recipient. The delegate clearly writes the recipient’s name on the top of the letter. The delegate then puts the letter in an e nvelope and writes the address of the destination house on the envelope. The delegate then gives the letter to the planet’s mail service. At the receiving side, the delegate receives the letter from the mail service, takes the letter out of the envelope, and takes note of the recipient name written at the top of the letter. The delegate than gives the letter to the family member with this name.b.No, the mail service does not have to open the envelope; it only examines the address on theenvelope.3. (Q3) Describe why an application developer might choose to run an application over UDP rather than TCP.Answer:An application developer may not want its application to use TCP’s congestion control, which can throttle the application’s sending rate at times of congestion. Often, designers of IP telephony and IP videoconference applications choose to run their applications over UDP because they want to avoid TCP’s congestion control. Also, some applications do not need the reliable data transfer provided by TCP.4. (P1) Suppose Client A initiates a Telnet session with Server S. At about the same time, Client B also initiates a Telnet session with Server S. Provide possible source and destination port numbers fora. The segment sent from A to B.b. The segment sent from B to S.c. The segment sent from S to A.d. The segment sent from S to B.e. If A and B are different hosts, is it possible that the source port number in the segment fromA to S is the same as that fromB to S?f. How about if they are the same host?Yes.f No.5. (P2) Consider Figure 3.5 What are the source and destination port values in the segmentsflowing form the server back to the clients’ processes? What are the IP addresses in the network-layer datagrams carrying the transport-layer segments?Answer:Suppose the IP addresses of the hosts A, B, and C are a, b, c, respectively. (Note that a,b,c aredistinct.)To host A: Source port =80, source IP address = b, dest port = 26145, dest IP address = a To host C, left process: Source port =80, source IP address = b, dest port = 7532, dest IP address = cTo host C, right process: Source port =80, source IP address = b, dest port = 26145, dest IP address = c6. (P3) UDP and TCP use 1s complement for their checksums. Suppose you have the followingthree 8-bit bytes: 01101010, 01001111, 01110011. What is the 1s complement of the sum of these 8-bit bytes? (Note that although UDP and TCP use 16-bit words in computing the checksum, for this problem you are being asked to consider 8-bit sums.) Show all work. Why is it that UDP takes the 1s complement of the sum; that is , why not just sue the sum? With the 1s complement scheme, how does the receiver detect errors? Is it possible that a 1-bit error will go undetected? How about a 2-bit error?Answer:One's complement = 1 1 1 0 1 1 1 0.To detect errors, the receiver adds the four words (the three original words and the checksum). If the sum contains a zero, the receiver knows there has been an error. All one-bit errors will be detected, but two-bit errors can be undetected (e.g., if the last digit of the first word is converted to a 0 and the last digit of the second word is converted to a 1).7. (P4) Suppose that the UDP receiver computes the Internet checksum for the received UDPsegment and finds that it matches the value carried in the checksum field. Can the receiver be absolutely certain that no bit errors have occurred? Explain.Answer:No, the receiver cannot be absolutely certain that no bit errors have occurred. This is because of the manner in which the checksum for the packet is calculated. If the corresponding bits (that would be added together) of two 16-bit words in the packet were 0 and 1 then even if these get flipped to 1 and 0 respectively, the sum still remains the same. Hence, the 1s complement the receiver calculates will also be the same. This means the checksum will verify even if there was transmission error.8. (P5) a. Suppose you have the following 2 bytes: 01001010 and 01111001. What is the 1scomplement of sum of these 2 bytes?b. Suppose you have the following 2 bytes: 11110101 and 01101110. What is the 1s complement of sum of these 2 bytes?c. For the bytes in part (a), give an example where one bit is flipped in each of the 2 bytesand yet the 1s complement doesn’t change.0 1 0 1 0 1 0 1 + 0 1 1 1 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 0 1 + 0 1 0 0 1 1 0 0 0 0 0 1 0 0 0 1Answer:a. Adding the two bytes gives 10011101. Taking the one’s complement gives 01100010b. Adding the two bytes gives 00011110; the one’s complement gives 11100001.c. first byte = 00110101 ; second byte = 01101000.9. (P6) Consider our motivation for correcting protocol rdt2.1. Show that the receiver, shown inthe figure on the following page, when operating with the sender show in Figure 3.11, can lead the sender and receiver to enter into a deadlock state, where each is waiting for an event that will never occur.Answer:Suppose the sender is in state “Wait for call 1 from above” and the receiver (the receiver shown in the homework problem) is in state “Wait for 1 from below.” The sender sends a packet with sequence number 1, and transitions to “Wait for ACK or NAK 1,” waiting for an ACK or NAK. Suppose now the receiver receives the packet with sequence number 1 correctly, sends an ACK, and transitions to state “Wait for 0 from below,” waiting for a data packet with sequence number 0. However, the ACK is corrupted. When the rdt2.1 sender gets the corrupted ACK, it resends the packet with sequence number 1. However, the receiver is waiting for a packet with sequence number 0 and (as shown in the home work problem) always sends a NAK when it doesn't get a packet with sequence number 0. Hence the sender will always be sending a packet with sequence number 1, and the receiver will always be NAKing that packet. Neither will progress forward from that state.10. (P7) Draw the FSM for the receiver side of protocol rdt3.0Answer:The sender side of protocol rdt3.0 differs from the sender side of protocol 2.2 in that timeouts have been added. We have seen that the introduction of timeouts adds the possibility of duplicate packets into the sender-to-receiver data stream. However, the receiver in protocol rdt.2.2 can already handle duplicate packets. (Receiver-side duplicates in rdt 2.2 would arise if the receiver sent an ACK that was lost, and the sender then retransmitted the old data). Hence the receiver in protocol rdt2.2 will also work as the receiver in protocol rdt 3.0.11. (P8) In protocol rdt3.0, the ACK packets flowing from the receiver to the sender do not havesequence numbers (although they do have an ACK field that contains the sequence number of the packet they are acknowledging). Why is it that our ACK packets do not require sequence numbers?Answer:To best Answer this question, consider why we needed sequence numbers in the first place. We saw that the sender needs sequence numbers so that the receiver can tell if a data packet is a duplicate of an already received data packet. In the case of ACKs, the sender does not need this info (i.e., a sequence number on an ACK) to tell detect a duplicate ACK. A duplicate ACK is obvious to the rdt3.0 receiver, since when it has received the original ACK it transitioned to the next state. The duplicate ACK is not the ACK that the sender needs and hence is ignored by the rdt3.0 sender.12. (P9) Give a trace of the operation of protocol rdt3.0 when data packets and acknowledgmentpackets are garbled. Your trace should be similar to that used in Figure 3.16Answer:Suppose the protocol has been in operation for some time. The sender is in state “Wait for call fro m above” (top left hand corner) and the receiver is in state “Wait for 0 from below”. The scenarios for corrupted data and corrupted ACK are shown in Figure 1.13. (P10) Consider a channel that can lose packets but has a maximum delay that is known.Modify protocol rdt2.1 to include sender timeout and retransmit. Informally argue whyyour protocol can communicate correctly over this channel.Answer:Here, we add a timer, whose value is greater than the known round-trip propagation delay. We add a timeout event to the “Wait for ACK or NAK0” and “Wait for ACK or NAK1” states. If the timeout event occurs, the most recently transmitted packet is retransmitted. Let us see why this protocol will still work with the rdt2.1 receiver.• Suppose the timeout is caused by a lost data packet, i.e., a packet on the senderto- receiver channel. In this case, the receiver never received the previous transmission and, from the receiver's viewpoint, if the timeout retransmission is received, it look exactly the same as if the original transmission is being received.• Suppose now that an ACK is lost. The receiver will eventually retransmit the packet on atimeout. But a retransmission is exactly the same action that is take if an ACK is garbled. Thus the sender's reaction is the same with a loss, as with a garbled ACK. The rdt 2.1 receiver can already handle the case of a garbled ACK.14. (P11) Consider the rdt3.0 protocol. Draw a diagram showing that if the network connectionbetween the sender and receiver can reorder messages (that is, that two messagespropagating in the medium between the sender and receiver can be reordered), thenthe alternating-bit protocol will not work correctly (make sure you clearly identify thesense in which it will not work correctly). Your diagram should have the sender on theleft and the receiver on the right, with the time axis running down the page, showingdata (D) and acknowledgement (A) message exchange. Make sure you indicate thesequence number associated with any data or acknowledgement segment.Answer:15. (P12) The sender side of rdt3.0 simply ignores (that is, takes no action on) all received packetsthat are either in error or have the wrong value in the ack-num field of anacknowledgement packet. Suppose that in such circumstances, rdt3.0 were simply toretransmit the current data packet . Would the protocol still work? (hint: Consider whatwould happen if there were only bit errors; there are no packet losses but prematuretimeout can occur. Consider how many times the nth packet is sent, in the limit as napproaches infinity.)Answer:The protocol would still work, since a retransmission would be what would happen if the packet received with errors has actually been lost (and from the receiver standpoint, it never knows which of these events, if either, will occur). To get at the more subtle issue behind this question, one has to allow for premature timeouts to occur. In this case, if each extra copy of the packet is ACKed and each received extra ACK causes another extra copy of the current packet to be sent, the number of times packet n is sent will increase without bound as n approaches infinity.16. (P13) Consider a reliable data transfer protocol that uses only negative acknowledgements.Suppose the sender sends data only infrequently. Would a NAK-only protocol bepreferable to a protocol that uses ACKs? Why? Now suppose the sender has a lot ofdata to send and the end to end connection experiences few losses. In this second case ,would a NAK-only protocol be preferable to a protocol that uses ACKs? Why?Answer:In a NAK only protocol, the loss of packet x is only detected by the receiver when packetx+1 is received. That is, the receivers receives x-1 and then x+1, only when x+1 is received does the receiver realize that x was missed. If there is a long delay between the transmission of x and the transmission of x+1, then it will be a long time until x can be recovered, under a NAK only protocol.On the other hand, if data is being sent often, then recovery under a NAK-only scheme could happen quickly. Moreover, if errors are infrequent, then NAKs are only occasionally sent (when needed), and ACK are never sent – a significant reduction in feedback in the NAK-only case over the ACK-only case.17. (P14) Consider the cross-country example shown in Figure 3.17. How big would the windowsize have to be for the channel utilization to be greater than 80 percent?Answer:It takes 8 microseconds (or 0.008 milliseconds) to send a packet. in order for the sender to be busy 90 percent of the time, we must have util = 0.9 = (0.008n) / 30.016 or n approximately 3377 packets.18. (P15) Consider a scenario in which Host A wants to simultaneously send packets to Host Band C. A is connected to B and C via a broadcast channel—a packet sent by A is carriedby the channel to both B and C. Suppose that the broadcast channel connecting A, B,and C can independently lose and corrupt packets (and so, for example, a packet sentfrom A might be correctly received by B, but not by C). Design a stop-and-wait-likeerror-control protocol for reliable transferring packets from A to B and C, such that Awill not get new data from the upper layer until it knows that B and C have correctlyreceived the current packet. Give FSM descriptions of A and C. (Hint: The FSM for Bshould be essentially be same as for C.) Also, give a description of the packet format(s)used.Answer:In our solution, the sender will wait until it receives an ACK for a pair of messages (seqnum and seqnum+1) before moving on to the next pair of messages. Data packets have a data field and carry a two-bit sequence number. That is, the valid sequence numbers are 0, 1, 2, and 3. (Note: you should think about why a 1-bit sequence number space of 0, 1 only would not work in the solution below.) ACK messages carry the sequence number of the data packet they are acknowledging.The FSM for the sender and receiver are shown in Figure 2. Note that the sender state records whether (i) no ACKs have been received for the current pair, (ii) an ACK for seqnum (only) has been received, or an ACK for seqnum+1 (only) has been received. In this figure, we assume that theseqnum is initially 0, and that the sender has sent the first two data messages (to get things going).A timeline trace for the sender and receiver recovering from a lost packet is shown below:Sender Receivermake pair (0,1)send packet 0Packet 0 dropssend packet 1receive packet 1buffer packet 1send ACK 1receive ACK 1(timeout)resend packet 0receive packet 0deliver pair (0,1)send ACK 0receive ACK 019. (P16) Consider a scenario in which Host A and Host B want to send messages to Host C. HostsA and C are connected by a channel that can lose and corrupt (but not reorder)message.Hosts B and C are connected by another channel (independent of the channelconnecting A and C) with the same properties. The transport layer at Host C shouldalternate in delivering messages from A and B to the layer above (that is, it should firstdeliver the data from a packet from A, then the data from a packet from B, and so on).Design a stop-and-wait-like error-control protocol for reliable transferring packets fromA toB and C, with alternating delivery atC as described above. Give FSM descriptionsof A and C. (Hint: The FSM for B should be essentially be same as for A.) Also, give adescription of the packet format(s) used.Answer:This problem is a variation on the simple stop and wait protocol (rdt3.0). Because the channel may lose messages and because the sender may resend a message that one of the receivers has already received (either because of a premature timeout or because the other receiver has yet to receive the data correctly), sequence numbers are needed. As in rdt3.0, a 0-bit sequence number will suffice here.The sender and receiver FSM are shown in Figure 3. In this problem, the sender state indicates whether the sender has received an ACK from B (only), from C (only) or from neither C nor B. The receiver state indicates which sequence number the receiver is waiting for.20. (P17) In the generic SR protocol that we studied in Section 3.4.4, the sender transmits amessage as soon as it is available (if it is in the window) without waiting for anacknowledgment. Suppose now that we want an SR protocol that sends messages twoat a time. That is , the sender will send a pair of messages and will send the next pairof messages only when it knows that both messages in the first pair have been receivercorrectly.Suppose that the channel may lose messages but will not corrupt or reorder messages.Design an error-control protocol for the unidirectional reliable transfer of messages.Give an FSM description of the sender and receiver. Describe the format of the packetssent between sender and receiver, and vice versa. If you use any procedure calls otherthan those in Section 3.4(for example, udt_send(), start_timer(), rdt_rcv(), and soon) ,clearly state their actions. Give an example (a timeline trace of sender and receiver)showing how your protocol recovers from a lost packet.Answer:21. (P18) Consider the GBN protocol with a sender window size of 3 and a sequence numberrange of 1024. Suppose that at time t, the next in-order packet that the receiver isexpecting has a sequence number of k. Assume that the medium does not reordermessages. Answer the following questions:a. What are the possible sets of sequence number inside the sender’s window at timet? Justify your Answer.b .What are all possible values of the ACK field in all possible messages currentlypropagating back to the sender at time t? Justify your Answer.Answer:a.Here we have a window size of N=3. Suppose the receiver has received packet k-1, and hasACKed that and all other preceeding packets. If all of these ACK's have been received by sender, then sender's window is [k, k+N-1]. Suppose next that none of the ACKs have been received at the sender. In this second case, the sender's window contains k-1 and the N packets up to and including k-1. The sender's window is thus [k- N,k-1]. By these arguments, the senders window is of size 3 and begins somewhere in the range [k-N,k].b.If the receiver is waiting for packet k, then it has received (and ACKed) packet k-1 and the N-1packets before that. If none of those N ACKs have been yet received by the sender, then ACKmessages with values of [k-N,k-1] may still be propagating back. Because the sender has sent packets [k-N, k-1], it must be the case that the sender has already received an ACK for k-N-1.Once the receiver has sent an ACK for k-N-1 it will never send an ACK that is less that k-N-1.Thus the range of in-flight ACK values can range from k-N-1 to k-1.22. (P19) Answer true or false to the following questions and briefly justify your Answer.a. With the SR protocol, it is possible for the sender to receive an ACK for a packet thatfalls outside of its current window.b. With CBN, it is possible for the sender to receiver an ACK for a packet that fallsoutside of its current window.c. The alternating-bit protocol is the same as the SR protocol with a sender and receiverwindow size of 1.d. The alternating-bit protocol is the same as the GBN protocol with a sender andreceiver window size of 1.Answer:a.True. Suppose the sender has a window size of 3 and sends packets 1, 2, 3 at t0 . At t1 (t1 > t0)the receiver ACKS 1, 2, 3. At t2 (t2 > t1) the sender times out and resends 1, 2, 3. At t3 the receiver receives the duplicates and re-acknowledges 1, 2, 3. At t4 the sender receives the ACKs that the receiver sent at t1 and advances its window to 4, 5, 6. At t5 the sender receives the ACKs 1, 2, 3 the receiver sent at t2 . These ACKs are outside its window.b.True. By essentially the same scenario as in (a).c.True.d.True. Note that with a window size of 1, SR, GBN, and the alternating bit protocol arefunctionally equivalent. The window size of 1 precludes the possibility of out-of-order packets (within the window). A cumulative ACK is just an ordinary ACK in this situation, since it can only refer to the single packet within the window.23. (Q4) Why is it that voice and video traffic is often sent over TCP rather than UDP in today’sInternet. (Hint: The Answer we are looking for has nothing to do with TCP’s congestion-control mechanism. )Answer:Since most firewalls are configured to block UDP traffic, using TCP for video and voice traffic lets the traffic though the firewalls24. (Q5) Is it possible for an application to enjoy reliable data transfer even when the applicationruns over UDP? If so, how?Answer:Yes. The application developer can put reliable data transfer into the application layer protocol. This would require a significant amount of work and debugging, however.25. (Q6) Consider a TCP connection between Host A and Host B. Suppose that the TCP segmentstraveling form Host A to Host B have source port number x and destination portnumber y. What are the source and destination port number for the segments travelingform Host B to Host A?Answer:Source port number y and destination port number x.26. (P20) Suppose we have two network entities, A and B. B has a supply of data messages thatwill be sent to A according to the following conventions. When A gets a request fromthe layer above to get the next data (D) message from B, A must send a request (R)message to B on the A-to-B channel. Only when B receives an R message can it send adata (D) message back to A on the B-to-A channel. A should deliver exactly one copy ofeach D message to the layer above. R message can be lost (but not corrupted) in the A-to-B channel; D messages, once sent, are always delivered correctly. The delay alongboth channels is unknown and variable.Design(give an FSM description of) a protocol that incorporates the appropriatemechanisms to compensate for the loss-prone A-to-B channel and implementsmessage passing to the layer above at entity A, as discussed above. Use only thosemechanisms that are absolutely necessary.Answer:Because the A-to-B channel can lose request messages, A will need to timeout and retransmit its request messages (to be able to recover from loss). Because the channel delays are variable and unknown, it is possible that A will send duplicate requests (i.e., resend a request message that has already been received by B). To be able to detect duplicate request messages, the protocol will use sequence numbers. A 1-bit sequence number will suffice for a stop-and-wait type of request/response protocol.A (the requestor) has 4 states:• “Wait for Request 0 from above.” Here the requestor is waiting for a call from above to request a unit of data. When it receives a request from above, it sends a request message, R0, to B, starts a timer and make s a transition to the “Wait for D0” state. When in the “Wait for Request 0 from above” state, A ign ores anything it receives from B.• “Wait for D0”. Here the requestor is waiting for a D0 data message from B. A timer is always running in this state. If the timer expires, A sends another R0 message, restarts the timer and remains in this state. If a D0 message is received from B, A stops the time and transits to the “Wait for Request 1 from above” state. If A receives a D1 data message while in this state, it is ignored.• “Wait for Request 1 from above.” Here the requestor is again waiting for a call from above to request a unit of data. When it receives a request from above, it sends a request message, R1, to B, starts a timer and makes a transition to the “Wait for D1” state. When in the “Wait for Request 1 from above” state, A ignores anything it receives from B.• “Wait for D1”. Here the requestor is waiting for a D1 data message from B. A timer is always running in this state. If the timer expires, A sends another R1 message, restarts the timer and remains in this state. If a D1 message is received from B, A stops the timer and transits to the “Wait for Request 0 from above” state. If A receives a D0 data message while in this state, it is ignored.The data supplier (B) has only two states:。
.第三章习题课一、选择题1、在汇编语言程序的开发过程中使用宏功能的顺序是()。
A、宏定义,宏调用B、宏定义,宏展开C、宏定义,宏调用,宏展开D、宏定义,宏展开,宏调用2、汇编语言源程序中,每个语句由四项组成,如语句要完成一定功能,那么该语句中不可省略的项是()。
A、名字项B、操作项C、操作数项D、注释项3、下列叙述正确的是()A.对两个无符号数进行比较采用CMP指令,对两个有符号数比较用CMPS指令B.对两个无符号数进行比较采用CMPS指令,对两个有符号数比较用CMP指令C.对无符号数条件转移采用JAE/JNB指令,对有符号数条件转移用JGE/JNL指令D.对无符号数条件转移采用JGE/JNL指令,对有符号数条件转移用JAE/JNB指令4、编写分支程序,在进行条件判断前,可用指令构成条件,其中不能形成条件的指令有().A、CMPB、SUBC、ANDD、MOV5、测试BL寄存器容是否与数据4FH相等,若相等则转NEXT处执行,可实现的方法是()。
A TEST BL,4FHJZ NEXTB XOR BL,4FHJZ NEXTC AND BL,4FHJZ NEXTD OR BL,4FHJZ NEXT6、检查BUF的容是否为正偶数,如是正偶数,则令AL=0。
下面程序段正确的是( )。
A、MOV AL,BUF JS K1SHR AL,1JNC K1MOV AL,0K1:……B、MOV AL,BUF AND AL,11 JNZ K2MOV AL,0K2:……C 、MOV AL ,BUF TEST AL ,81H JNZ K3 MOV AL ,0 K3:……7、下列描述中,执行循环的次数最多的情况是()。
A .MOV CX ,0B .MOV CX ,1 LOP :LOOP LOP LOP :LOOP LOPC .MOV CX ,0FFFFHD .MOV CX ,256 LOP :LOOP LOP LOP :LOOP LOP8、在下列指令中,指令的执行会影响条件码中的CF 位。