FreeBSD networking question

ithilgore advent.cloud.strife at gmail.com
Fri Feb 1 10:32:25 EET 2008


V13 wrote:
> On Friday 01 February 2008, ithilgore wrote:
>   
>>     b) Einai pio eukolo na akolou8hsei kaneis ena book ( tcp ip vol 2
>> ---> bsd ) para na piasei monos tou thn network stack tou linux
>> btw exw diabasei meros tou "linux network internals" alla einai pio polu
>> reference kai asxoleitai mexri to L3 ( no tcp dhladh )
>>     
>
>   Exontas koitaksei ton kodika poy afora to TCP sto linux, den mporo na 
> katalabo ti dyskolia tha synantiseis ean exeis koitaksei kai katalabei ola ta 
> parakato (L2 & L3). Einai arista documented kai 100% eyanagnostos 
> (toylaxiston ta kommatia ta opoia exo koitaksei).  Mipos h aporia soy den 
> exei na kanei toso me to implementation alla me toys epi meroys algorithmoys? 
> Aloste, to implementation einai kata kanona efarmogi ton protypon kai ton 
> algorithmon.
>
>   PoC: Endeiktiko documentation apo to tcp.c:
>
>         /*
>          * POLLHUP is certainly not done right. But poll() doesn't
>          * have a notion of HUP in just one direction, and for a
>          * socket the read side is more interesting.
>          *
>          * Some poll() documentation says that POLLHUP is incompatible
>          * with the POLLOUT/POLLWR flags, so somebody should check this
>          * all. But careful, it tends to be safer to return too many
>          * bits than too few, and you can easily break real applications
>          * if you don't tell them that something has hung up!
>          *
>          * Check-me.
>          *
>          * Check number 1. POLLHUP is _UNMASKABLE_ event (see UNIX98 and
>          * our fs/select.c). It means that after we received EOF,
>          * poll always returns immediately, making impossible poll() on 
> write()
>          * in state CLOSE_WAIT. One solution is evident --- to set POLLHUP
>          * if and only if shutdown has been made in both directions.
>          * Actually, it is interesting to look how Solaris and DUX
>          * solve this dilemma. I would prefer, if PULLHUP were maskable,
>          * then we could set it on SND_SHUTDOWN. BTW examples given
>          * in Stevens' books assume exactly this behaviour, it explains
>          * why PULLHUP is incompatible with POLLOUT.    --ANK
>          *
>          * NOTE. Check for TCP_CLOSE is added. The goal is to prevent
>          * blocking on fresh not-connected or disconnected socket. --ANK
>          */
>         if (sk->sk_shutdown == SHUTDOWN_MASK || sk->sk_state == TCP_CLOSE)
>                 mask |= POLLHUP;
>         if (sk->sk_shutdown & RCV_SHUTDOWN)
>                 mask |= POLLIN | POLLRDNORM | POLLRDHUP;
>
> ... nai... ta parapano sxolia aforoyn tis 2 aytes grammes... meta exei alla...
>
>   
>> ithilgore
>>     
> <<V13>>
>
>
>   
Den diafwnw oti to implementation einai efarmogh twn algori8mwn, omws 
polles fores sto actual coding
krubodai pagides pou to RFC den mporei na exei labei upopsin tou + oti 
yparxei to 8ema design sto olo modelo
to opoio exei na kanei kai me thn armonikh sumbiwsh olwn autwn twn 
pragmatwn se ena eniaio purhna

Dhladh mporei memonwmena enas algorithmos na einai katanohtos alla sto 
implementation tou 8a prepei na lhf8un upopsin kai pragmata pou exun na 
kanun me pio specific aspects tou idiou tou kernel ( bl px ta 
notification chains )

Epishs sunexizw na epimenw sto oti oso pio polla locs exei na 
adimetwpisei kaneis toso pio duskolo einai, dedomenou oti
kai oi 2 purhnes ( FreeBSD - linux ) exoun to idio kalo documentation ( 
an kai se auto isws diafwnhsoun kapoioi uper tou 1ou )

ithilgore




More information about the Linux-greek-users mailing list