Subject: Re: [forces] comments #11

From: "Wang,Weiming" <[email-masked]>
Date: Mon, 19 Sep 2011 14:50:25 +0800

Hi Jamal and Chuanhuang,

I'v modified the whole text for the Next Hop LFB as below, which include all you discussed. Pls check to review it. 

After your response, I hope to close this issue.

thanks,
Weiming
----------
5.3.2. IPv4NextHop
 
This LFB abstracts the process of selecting ipv4 next hop action.  
 
5.3.2.1. Data Handling
 
The LFB abstracts the process of next hop information application to IPv4 packets. It receives an IPv4 packet with an associated next hop identifier (HopSelector), and uses the identifier as a table index to look up a next hop table to find an appropriate LFB output port.
   
The LFB is expected to receive unicast IPv4 packets, via a singleton input known as "PcktsIn" along with a HopSelector metadata which is used as a table index to lookup the NextHop table. The data processing involves the forwarding TTL decrement and IP checksum recalculation. 
 
Two output LFB ports are defined. 
 
The first output is a group output port known as "SuccessOut". On    successful data processing the packet is sent out an LFB-port from   within the LFB port group as selected by the LFBOutputSelectIndex   value of the matched table entry. The packet is sent to a downstream   LFB alongside with the L3PortID and MediaEncapInfoIndex metadata. 
   
The second output is a singleton output port known as "ExceptionOut",   which will output packets for which the data processing failed, along with an additional ExceptionID metadata to indicate what caused the exception. Currently defined exception types include: 
o The HopSelector for the packet is invalid.
o The packet failed lookup of the NextHop table even though the HopSelector is valid.
o The MTU for outgoing interface is less than the packet size.
 
Downstream LFB instances could be either a BasicMetadataDispatch type (Section 5.5.1), used to fanout to different LFB instances or a media encapsulation related type, such as an EtherEncap type or a RedirectOut type(Section 5.4.2). For example, if there are Ethernet and other tunnel Encapsulation, then a BasicMetadataDispatch LFB can use the L3PortID metadata (See section below) to dispatch packets to different Encapsulator. 
 
5.3.2.2. Components
 
This LFB has only one component named IPv4NextHopTable which is defined as an array. The array index of IPv4NextHopTable is used for a HopSelector to find out a row of the table as the next hop information. Each row of the array is a struct containing: 
   O The L3PortID, which is the ID of the Logical Output Port that is passed onto the downstream LFB instance. This ID indicates what port to the neighbor is as defined by L3. 
   O MTU, the Maximum Transmission Unit for the outgoing port. 
   O NextHopIPAddr, the IPv4 next hop Address. 
O MediaEncapInfoIndex, the index we pass onto the downstream LFB instance. This index is used as a search key to lookup a table (typically media encapsulation related) further downstream. In some cases, depending on implementation, the CE may set the MediaEncapInfoIndex passed downstream to a value that will fail lookup when it gets to a target encapsulation LFB; such a lookup failure at that point is an indication that further resolution is needed. For an example of this approach refer to section 7.2 which talks about ARP and mentions this approach.
   o LFBOutputSelectIndex, the LFB Group output port index to select downstream LFB port. This index exactly is the FromPortIndex for the port group "SuccessOut" in the table LFBTopology of FEObject LFB as defined in the Nexthop LFB.
--------------

----- Original Message ----- 
From: "Jamal Hadi Salim" <[email-masked]>

>>> 28)5.3.2.1.
>>> "The packet is sent to a downstream LFB alongside with the L3PortID
>>> and MediaEncapInfoIndex metadata."
>>> I think it would be useful to mention where these metadata were received
>>> from.
> MediaEncapInfoIndex will be used in media encapsulation LFB, such as EtherEncap.
> If there are more than one media encapsulation LFBs(for example, EtherEncap,
> L2/TunnelEncap), BasicMetadataDispatch will use L3PortID to dispatch packet to
> different encapsulation LFBs.

You already have similar text in the last paragraph of that section.
I was talking about where metadata was created not where it is to be consumed.
In retrospect, dont bother adding text above - I think the text will
be slightly harder to read as it stands, but we can live with it.

>>> 29)5.3.2.1.
>>> "ICMP packet needs to be generated"
>>> Could you summarize why ICMP packets need to be generated?
> The main reason is there are no routes at all (including no default route) for the packet.
> I suggest modifying this execption to "There are no routes for the packet" directly.
>

Ok - thats useful to add.

cheers,
jamal

---

From: Jamal Hadi Salim <[email-masked]>
Date: Mon, 19 Sep 2011 07:09:32 -0400

Hi Weiming,

ACK with comments below:

On Mon, Sep 19, 2011 at 2:50 AM, Wang,Weiming <[email-masked]> wrote:
> Downstream LFB instances could be either a BasicMetadataDispatch type (Section 5.5.1), used to fanout to different LFB instances or a media encapsulation >related type, such as an EtherEncap type or a RedirectOut type(Section 5.4.2). For example, if there are Ethernet and other tunnel Encapsulation, then a >BasicMetadataDispatch LFB can use the L3PortID metadata (See section below) to dispatch packets to different Encapsulator.

I would suggest to use xrefs for the sections mentioned above; if
those sections get
moved, it still works. Also instead of "section below" - just add xref
to proper section.

> 5.3.2.2. Components
>
>This LFB has only one component named IPv4NextHopTable which is defined as an array. The array index of IPv4NextHopTable is used for a HopSelector to find >out a row of the table as the next hop information. Each row of the array is a struct containing:

The last sentence on L3PortID is unclear.
I may have missed it - but I think, somewhere, we need to specify what
L3PortID represents.
Some text from Joel's email here can be used:
https://www.ietf.org/mail-archive/web/forces/current/msg03999.html

> O MediaEncapInfoIndex, the index we pass onto the downstream LFB instance. This index is used as a search key to lookup a table (typically media encapsulation
> related) further downstream. In some cases, depending on implementation, the CE may set the MediaEncapInfoIndex passed downstream to a value that will fail
> lookup when it gets to a target encapsulation LFB; such a lookup failure at that point is an indication that further resolution is needed. For an example of this
> approach refer to section 7.2 which talks about ARP and mentions this approach.
>   o LFBOutputSelectIndex, the LFB Group output port index to select downstream LFB port. This index exactly is the FromPortIndex for the port group
> "SuccessOut" in the table LFBTopology of FEObject LFB as defined in the Nexthop LFB.
> --------------

Last sentence is a little confusing; maybe re-write as:
" LFBOutputSelectIndex is a 1-to-1 mapping with FEObject LFB's table
LFBTopology(RFC 5812)
component FromPortIndex  corresponding to the port group mapping
FromLFBID as IPv4NextHop LFB instance."

cheers,
jamal

---

From: "Wang,Weiming" <[email-masked]>
Date: Thu, 22 Sep 2011 20:49:05 +0800

Jamal，and Chuanhuang as well,

pls see reply inline. 

thanks,
Weiming
----- Original Message ----- 
  
> O The L3PortID, which is the ID of the Logical Output Port that is passed onto the downstream LFB instance. This ID indicates what port to the neighbor is as

Jamal: The last sentence on L3PortID is unclear.
I may have missed it - but I think, somewhere, we need to specify what
L3PortID represents.
Some text from Joel's email here can be used:
https://www.ietf.org/mail-archive/web/forces/current/msg03999.html

WangRe: I checked the email and I had decided to change last sentense to: 
" The L3PortID, which is the ID of the Logical Output Port that is passed onto the downstream LFB instance. This ID indicates what port to the neighbor is as defined by L3. Hence, the L3PortID acts as a conceptual dispatcher. By use of the L3PortID multiple encapsulation media LFBs may follow the NextHop LFB. "
But, later I found such change might be wrong, because the MediaEncapInfoIndex seems to do the work choosing next encapsulator LFBs. As a result, I'm at a loss. Chuanhuang,  pls give more detailed explanation. thks.

> O MediaEncapInfoIndex, the index we pass onto the downstream LFB instance. This index is used as a search key to lookup a table (typically media encapsulation related) further downstream. In some c…

WangRe: I remember Jamal modified this section. Can Chuanhuang and Jamal you help to review again the content?  When I read it again, I'm just a little puzzle at the 'failure' here maintioned. 

> "SuccessOut" in the table LFBTopology of FEObject LFB as defined in the Nexthop LFB.

Jamal: Last sentence is a little confusing; maybe re-write as:
" LFBOutputSelectIndex is a 1-to-1 mapping with FEObject LFB's table
LFBTopology(RFC 5812)
component FromPortIndex  corresponding to the port group mapping
FromLFBID as IPv4NextHop LFB instance."

WangRe: updated.

---

From: "Chuanhuang Li" <[email-masked]>
Date: Fri, 23 Sep 2011 09:28:02 +0800

>But, later I found such change might be wrong, because the MediaEncapInfoIndex seems to do the work choosing next encapsulator LFBs. As a result, I'm at a loss. Chuanhuang,  pls give more detailed e…

MediaEncapInfoIndex is used to select one entry in the EncapTable , if the downstream LFB is EtherEncap. 
It is an input metadata of EtherEncap. But L3PortID is used in BasicMetadataDispatch to dispatch the packet 
to different Media encapsulation LFBs, if there are different media encapsulation LFBs.  

>WangRe: I remember Jamal modified this section. Can Chuanhuang and Jamal you help to review again the content?  When I read it again, I'm just a little puzzle at the 'failure' here maintioned. 

This "failure" is occured in EtherEncap. It is just the execption case: "The MediaEncapInfoIndex value of the packet is 
invalid and can not be allocated in the EncapTable.". In this case, the packet need to be redirected to CE to do the 
address resolution. 

Yours,
Chuanhuang

---

From: "Wang,Weiming" <[email-masked]>
Date: Fri, 23 Sep 2011 11:26:04 +0800

> to different Media encapsulation LFBs, if there are different media encapsulation LFBs.  
As a result, I'v modified the text as below, Pls double check the correctness: 
----
The L3PortID, which is the ID of the Logical Output Port that is passed onto the downstream LFB instance. This ID indicates what port to the neighbor is as defined by L3. Usually this ID is used for the NextHop LFB to distinguish packets that need different L2 encapsulating. For instance, some packets may require general Ethernet encapsulation while others may require various types of tunnel encapsulations. In such case, different L3PortIDs are assigned to the packets and are as metadata passed to downstream LFB. A BasicMetadataDispatch LFB(See Section 5.5.1) may have to be applied as the downstream LFB so as to dispatch packets to different encapsulation LFBs according to the L3PortIDs. 
------

> invalid and can not be allocated in the EncapTable.". In this case, the packet need to be redirected to CE to do the 
Accordingly, I' to modify the text for MediaEncapInfoIndex as below: 
---
MediaEncapInfoIndex, the index we pass onto the downstream encapsulation LFB instance and that is used there as a search key to lookup a table (typically media encapsulation related) for further encapsulation information. Note that an encapsulation LFB instance may not directly follow the NextHop LFB, but the index is passed as a metadata associated, as such an encapsulation LFB instance even further downstream to the NextHop LFB can still use the index. In some cases, depending on implementation, the CE may set the MediaEncapInfoIndex passed downstream to a value that will fail lookup when it gets to a target encapsulation LFB; such a lookup failure at that point is an indication that further resolution is needed. For an example of this approach refer to section 7.2 which talks about ARP and mentions this approach.
---------

Jamal as well, pls double check the text. 

thnks,
Weiming

---

From: Jamal Hadi Salim <[email-masked]>
Date: Fri, 23 Sep 2011 11:24:20 -0400

Hi Weiming,
Just a small editorial comment below:

On Thu, Sep 22, 2011 at 11:26 PM, Wang,Weiming <[email-masked]> wrote:

> The L3PortID, which is the ID of the Logical Output Port that is passed onto the >downstream LFB instance. This ID indicates what port to the neighbor is as defined by L3. >Usually this ID is used for the NextHop LFB to distinguish packets that need different L2 >encapsulating. For instance, some packets may require general Ethernet encapsulation >while others may require various types of tunnel encapsulations. In such case, different >L3PortIDs are assigned to the packets and are as metadata passed to downstream LFB. >A BasicMetadataDispatch LFB(See Section 5.5.1) may have to be applied as the >downstream LFB so as to dispatch packets to different encapsulation LFBs according to >the L3PortIDs.

to:

The L3PortID is the ID of the Logical Output Port that is passed to
downstream LFB instances. This ID indicates a port to the L3 neighbor.
Usually this ID is used by
the NextHop LFB to distinguish packets that need different L2 encapsulating.
For instance, some packets may require general Ethernet encapsulation while
others may require various types of tunnel encapsulations. In such
case, different
L3PortIDs are assigned to the packets and are passed as metadata to downstream
LFB. A BasicMetadataDispatch LFB(See Section 5.5.1) may have to be
applied as the downstream LFB so as to dispatch packets to different
encapsulation LFBs according to
the L3PortIDs.

cheers,
jamal