• Nenhum resultado encontrado

Nesta dissertação, apresentamos os detalhes de uma proposta de implementação para suportar alta disponibilidade em um framework NFV no que tange à organização de rede para possibilitar o acesso à instância redundante de um serviço VNF, descrevendo as implementações realizadas em um experimento utilizando a plataforma OSM. Pode- mos concluir que o projeto OSM tem conseguido mapear os requisitos e definições da padronização ETSI, tornando-se assim uma plataforma em que o framework permite a implementação de requisitos de alta disponibilidade da forma como definida no padrão. Nossa intenção é interagir com a comunidade que contribui para o projeto OSM a fim de disponibilizar nosso código para a plataforma de maneira aberta.

As Tabela 5 e Tabela 6 resumem as implementações feitas no código aberto do

OSM e ilustra a diferença de papéis do OpenMANO e OpenVIM, respectivamente. Tabela 5 – Resumo da implementação no OpenMANO.

Componentes do OpenMANO Implementação

Banco de dados Inserção dos novos campos high_availability, replicated e service_-

interfacena tabela instance_vms

vim_thread Implementação de registro de chamada de callback do nfvo quando um evento de mudança de estado de VM é identificado.

nfvo Implementação da função que é chamada pelo vim_thread quando um evento de mudança de estado de VM é identificado. A função analisa se uma VM é parte de uma VNF em alta disponibilidade e calcula quais mudanças na organização de rede são necessárias. vimconn Classe base para as implementações específicas de classes que

interfaceiam com VIMs definidos (OpenVIM, OpenStack ou AWS). Alteramos para incluir a assinatura de função de alteração de conectividade de rede.

vimconn_openvim Implementação da função changeNetworkBind que é chamada para alterar o bind de duas redes existentes e assim redirecionar os fluxos.

Tabela 6 – Resumo da implementação no OpenVIM.

Componente do OpenVIM Implementação

ovim Desenvolvimento de função que implementa o comando de alteração de bind de rede. Altera o banco de dados no campo bind_net e chama

edit_openflow_rules para que ocorra a redifinição dos fluxos e envio

dos comandos OpenFlow do FloodLight para o switch físico.

httpserver Implementação dos parâmetros de interface (json) e comandos REST do servidor HTTP do OpenVIM..

Os papéis do MANO e VIM na padronização podem ser observados como mapeados no OpenMANO e OpenVIM, respectivamente. A orquestração deve trazer a visão geral sobre os serviços nas quais a alta disponibilidade está inserida, no que diz respeito ao impacto

66 Capítulo 6. Conclusão e Trabalhos Futuros

sobre o encadeamento dos serviços, ao passo que o gerenciador de infraestrutura deve oferecer as informações sobre a conectividade e situação dos serviços por este gerenciados por meio das interfaces definidas pelos reference points da padronização. Em serviços dependentes de contexto com conexões TCP orientadas a sessões de aplicação, a conexão tem que ser refeita caso o contexto não seja replicado. Como descrevemos no início desta dissertação, não estamos avaliando a alta disponibilidade do ponto de vista da aplicação, o que exigiria o estudo e a implementação de uma aplicação complexa com avaliação detalhada e comparativa.

Um grande desafio a ser estudado é o impacto de serviços complexos encadeados e sujeitos à alta disponibilidade. A distribuição desses serviços em vários domínios pode gerar uma grande complexidade em relação à implementação da alta disponibilidade. Como descrito porOrdonez-Lucena et al. (2017), dado o dinamismo e escalabilidade que o particionamento de serviços de redes apresenta, o gerenciamento e orquestração não são implementações simples.

Como trabalhos futuros temos os seguintes tópicos propostos:

1. Proposta de mecanismo de monitoramento de eventos do OpenVIM para o Open-

MANO: como descrito na Seção 4, o OSM carece de uma solução que viabilize a

notificação em tempo real de eventos (modelo push) de mudança de estado de VMs como previsto pela padronização ETSI (2014c, seção 5.7.7).

2. Experimentação com um serviço NFV: um serviço como o proposto neste trabalho (serviço de distribuição de mídia) é representativo pela avaliação da continuidade de serviço. Como enriquecimento da experimentação, podemos implementar e avaliar também aspectos funcionais e de desempenho de aplicação típica NFV como NAT ou DPI. Um aspecto importante é o suporte da aplicação à alta disponibilidade como

proposto por Rajagopalan, Williams e Jamjoom (2013) (PICO). PICO Replication é

um framework sistêmico que implementa replicação de pacotes por fluxos (flow-level

replication). Esse mecanismo possibilita a verificação de falhas em altas frequências

enquanto o processo principal continua tratando as informações. O PICO Replication pode ser utilizado no contexto da padronização especificada em ETSI GS NFV-REL 002 (ETSI,2014a) em que são definidos métodos para alcançar a alta disponibilidade como o Lightweight Rollback Recovery.

3. Melhorias no provisionamento das informações de alta disponibilidade no Open-

MANO: como descrito na Seção 4, uma solução completa deve incluir o provisiona-

mento das informações de alta disponibilidade no OpenMANO, tal implementação consiste em alterações em interfaces gráficas e processos de instanciação de entidades dentro do OpenMANO.

67

4. Expansão do experimento para um contexto de mais amplo de encadeamento de ser- viço: aplicação do experimento para serviço encadeados e os efeitos na reorquestração dos serviços.

69

7 Apendice

7.1

Modificações e inserções de código no OpenMANO

Código inserido em nfvo.py:

def e x t r a c t _ n e t i d _ f r o m _ v i m _ i n f o ( vim_info , i n t e r f a c e ) :

# s e a r c h f o r i n f o r m a t i o n on n e t w o r k c o n n e c t i v i t y from vm_info

net_id_pos = s t r i n g . f i n d ( vim_info , " n e t _ i d " , s t r i n g . f i n d ( vim_info , i n t e r f a c e ) ) n e t _ i d = v i m _ i n f o [ net_id_pos + 8 : net_id_pos + 8 + 3 6 ]

return n e t _ i d

def _callback_vm_event ( vim_vm_id , d a t a c e n t e r _ t e n a n t _ i d ) :

’ ’ ’

C a l l b a c k f u n c t i o n upon VM s t a t u s c h a n g e r e p o r t e d by VIM t h r e a d ’ ’ ’

l o g g e r . debug ( " _callback_vm_event : ␣NOTIFICATION␣ARRIVED␣vim_vm_id␣%s ␣ : ␣ d a t a c e n t e r _ t e n a n t _ i d ␣%s " , \ vim_vm_id , d a t a c e n t e r _ t e n a n t _ i d ) n e t _ i d = None

bind_net_id = None

# I n i t i a l i z e DB c o n n e c t i o n

mydb = nfvo_db . nfvo_db ( ) ;

mydb . c o n n e c t ( g l o b a l _ c o n f i g [ ’ db_host ’ ] , g l o b a l _ c o n f i g [ ’ db_user ’ ] , \ g l o b a l _ c o n f i g [ ’ db_passwd ’ ] , g l o b a l _ c o n f i g [ ’ db_name ’ ] ) try :

a c t i v e _ i n s t a n c e = mydb . get_rows (SELECT=( ’ s t a t u s ’ , ’ h i g h _ a v a i l a b i l i t y ’ , ’ p r e v i o u s _ s t a t u s ’ , \ ’ v i m _ i n f o ’ , ’ r e p l i c a t e d _ i d ’ ) , ’ s e r v i c e _ i n t e r f a c e ’ \ FROM= ’ i n s t a n c e _ v m s ’ \

WHERE={ ’ vim_vm_id ’ : vim_vm_id} ) i f len ( a c t i v e _ i n s t a n c e ) == 0 :

l o g g e r . warn ( " n f v o . g e t _ h o s t s ␣ v i r t u a l ␣ machine ␣ a t ␣VIM␣ ’ { } ’ ␣ n o t ␣ f o u n d " . format ( vim_vm_id ) ) e l s e :

t e n a n t _ i d = mydb . get_rows (SELECT=( ’ n f v o _ t e n a n t _ i d ’ , ) , \

FROM= ’ t e n a n t s _ d a t a c e n t e r s ’ , \

WHERE={ ’ d a t a c e n t e r _ t e n a n t _ i d ’ : d a t a c e n t e r _ t e n a n t _ i d } ) l o g g e r . debug ( " _callback_vm_event : ␣ t e n a n t s ␣=␣%s " , t e n a n t _ i d )

f o r t e n a n t in t e n a n t _ i d :

vim_id , vim = get_vim_thread ( mydb , t e n a n t [ ’ n f v o _ t e n a n t _ i d ’ ] ) f o r vm_status in a c t i v e _ i n s t a n c e :

l o g g e r . debug ( " _callback_vm_event : ␣ c h a n g e ␣ i n ␣ s t a t u s ␣ f o r ␣ a c t i v e _ i n s t a n c e ␣%s : ␣ " + \ " [ s t a t u s=%s ] ␣ [ p r e v i o u s _ s t a t u s=%s ] ␣ [ h i g h _ a v a i l a b i l i t y=%s ] " , \ vim_vm_id , vm_status [ ’ s t a t u s ’ ] , vm_status [ ’ p r e v i o u s _ s t a t u s ’ ] , \ vm_status [ ’ h i g h _ a v a i l a b i l i t y ’ ] )

i f vm_status [ ’ h i g h _ a v a i l a b i l i t y ’ ] == ’ACTIVE_ACTIVE ’ or \\ vm_status [ ’ h i g h _ a v a i l a b i l i t y ’ ] == ’ACTIVE_PASSIVE ’ :

l o g g e r . debug ( " _callback_vm_event : ␣ a c t i v e _ i n s t a n c e ␣ h i g h _ a v a i l a b i l i t y ␣ " + \ "==␣ACTIVE_ACTIVE" )

70 Capítulo 7. Apendice

i f vm_status [ ’ s t a t u s ’ ] == "INACTIVE" or \ vm_status [ ’ s t a t u s ’ ] == "ERROR" or \ vm_status [ ’ s t a t u s ’ ] == "PAUSED" :

l o g g e r . debug ( " _callback_vm_event : ␣ a c t i v e _ i n s t a n c e ␣ vm_status [ ’ s t a t u s ’ ] ␣ " + \ "==␣ ␣%s " , vm_status [ ’ s t a t u s ’ ] ) i f vm_status [ ’ s t a t u s ’ ] != vm_status [ ’ p r e v i o u s _ s t a t u s ’ ] : # s t a t u s h a v e change , a c t i o n must b e t a k e n l o g g e r . debug ( " _callback_vm_event : ␣ a c t i v e _ i n s t a n c e ␣%s " , \ vm_status [ ’ v i m _ i n f o ’ ] ) # s e a r c h f o r i n f o r m a t i o n on n e t w o r k c o n n e c t i v i t y f o r a c t i v e vm n e t _ i d _ s e r v i c e = e x t r a c t _ n e t i d _ f r o m _ v i m _ i n f o ( vm_status [ ’ v i m _ i n f o ’ ] , \ vm_status [ ’ s e r v i c e _ i n t e r f a c e ’ ] ) l o g g e r . debug ( " _callback_vm_event : ␣ a c t i v e _ i n s t a n c e ␣ n e t _ i d _ s e r v i c e ␣%s " , \ n e t _ i d _ s e r v i c e ) r , n e t _ i d _ a c t i v e _ c o n n = vim . vim . g e t N e t w o r k C o n n e c t i o n ( n e t _ i d _ s e r v i c e ) l o g g e r . debug ( " _callback_vm_event : ␣ a c t i v e _ i n s t a n c e ␣ n e t _ i d _ a c t i v e _ c o n n ␣%s " , \ n e t _ i d _ a c t i v e _ c o n n [ ’ n e t _ i d ’ ] ) r , n e t _ i d _ a c t i v e _ s e r v i c e = \

vim . vim . ge tN etw ork Bi nd ( n e t _ i d _ a c t i v e _ c o n n [ ’ n e t _ i d ’ ] ) l o g g e r . debug ( " _callback_vm_event : ␣ a c t i v e _ i n s t a n c e ␣ " + \

" n e t _ i d _ a c t i v e _ c o n n ␣%s ␣ t o ␣ n e t _ i d _ a c t i v e _ s e r v i c e ␣%s " , \ n e t _ i d _ a c t i v e _ c o n n [ ’ n e t _ i d ’ ] , n e t _ i d _ a c t i v e _ s e r v i c e )

#t a k e n e t w o r k from s t a n d b y i n s t a n c e

s t a n d b y _ i n s t a n c e = mydb . get_rows (SELECT=( ’ s t a t u s ’ , ’ h i g h _ a v a i l a b i l i t y ’ , \ ’ p r e v i o u s _ s t a t u s ’ , ’ v i m _ i n f o ’ , \ ’ r e p l i c a t e d _ i d ’ , ’ s e r v i c e _ i n t e r f a c e ’ ) \ FROM= ’ i n s t a n c e _ v m s ’ , \ WHERE={ ’ u u i d ’ : vm_status [ ’ r e p l i c a t e d _ i d ’ ] } ) i f len ( s t a n d b y _ i n s t a n c e ) == 0 : l o g g e r . warn ( " _callback_vm_event : ␣ ’ { } ’ ␣ n o t ␣ f o u n d ␣ i n ␣ " + \ " i n s t a n c e _ v m s " . format ( vm_status [ ’ r e p l i c a t e d _ i d ’ ] ) ) e l s e : f o r vm_status_standby in s t a n d b y _ i n s t a n c e : n e t _ i d _ s e r v i c e = \ e x t r a c t _ n e t i d _ f r o m _ v i m _ i n f o ( vm_status [ ’ v i m _ i n f o ’ ] , \ vm_status [ ’ s e r v i c e _ i n t e r f a c e ’ ] l o g g e r . debug ( " _callback_vm_event : ␣ n e t _ i d _ s e r v i c e _ s t a n d b y ␣%s " , \ n e t _ i d _ s e r v i c e ) r , n e t _ i d _ s t a n d b y _ s e r v i c e = vim . vim . g e t N e t w o r k C o n n e c t i o n ( n e t _ i d _ s e r v i c e ) l o g g e r . debug ( " _callback_vm_event : ␣ s t a n d b y _ i n s t a n c e ␣ " + \ " n e t _ i d _ s t a n d b y _ s e r v i c e ␣%s " , \ n e t _ i d _ s t a n d b y _ s e r v i c e [ ’ n e t _ i d ’ ] ) r , net_id_standby_bind = \

vim . vim . ge tN etw ork Bi nd ( net_id_standby_bind [ ’ n e t _ i d ’ ] ) l o g g e r . debug ( " _callback_vm_event : ␣ s t a n d b y _ i n s t a n c e ␣ " + \

" net_id_standby_conn ␣%s ␣ b i n d e d ␣ t o ␣ net_id_standby_bind ␣%s " , \ n e t _ i d _ s t a n d b y _ s e r v i c e [ ’ n e t _ i d ’ ] , net_id_standby_bind ) vim . vim . changeNetworkBind ( n e t _ i d _ s t a n d b y _ t r a f f i c [ ’ b i n d _ i d ’ ] [ ’ u u i d ’ ] , \

n e t _ i d _ a c t i v e _ c o n n [ ’ n e t _ i d ’ ] ) l o g g e r . debug ( " _callback_vm_event : ␣SWITCH␣PROCESS␣TERMINATED" )

7.1. Modificações e inserções de código no OpenMANO 71

# p r e v i o u s s t a t u s = s t a t u s s i n c e t h e r e was a c h a n g e

mydb . update_rows ( " i n s t a n c e _ v m s " , UPDATE={ " p r e v i o u s _ s t a t u s " : vm_status [ ’ s t a t u s ’ ] } , WHERE={ " vim_vm_id " : vim_vm_id } )

except db_base_Exception a s e :

l o g g e r . warn ( " n f v o . _callback_vm_event ␣ v i r t u a l ␣ machine ␣VM␣ {} ␣ e r r o r ␣ {} " . format ( vim_vm_id ) , \ s t r ( e ) ) return

Código inserido em vimconn.py, classe base para interfacear com VIM (classes derivadas como por exemplo vimconn_openvim).

def changeNetworkBind ( s e l f , network_id , bind_net_id=None ) :

" " " Change n e t w o r k ’ s b i n d t h a t i n f l u e n c e s p a c k e t r o u t i n g i n OpenFlow s w i t c h " " " " " " R e t u r n s s t a t u s c o d e o f t h e VIM r e s p o n s e " " "

r a i s e vimconnNotImplemented ( " S h o u l d ␣ have ␣ implemented ␣ t h i s " ) def getNetworkBind ( s e l f , network_id ) :

" " " Change n e t w o r k ’ s b i n d t h a t i n f l u e n c e s p a c k e t r o u t i n g i n OpenFlow s w i t c h " " " " " " R e t u r n s s t a t u s c o d e o f t h e VIM r e s p o n s e " " "

r a i s e vimconnNotImplemented ( " S h o u l d ␣ have ␣ implemented ␣ t h i s " ) def g e t N e t w o r k C o n n e c t i o n ( s e l f , network_id ) :

" " " Change n e t w o r k ’ s b i n d t h a t i n f l u e n c e s p a c k e t r o u t i n g i n OpenFlow s w i t c h " " " " " " R e t u r n s s t a t u s c o d e o f t h e VIM r e s p o n s e " " "

r a i s e vimconnNotImplemented ( " S h o u l d ␣ have ␣ implemented ␣ t h i s " )

Código inserido em vimconn_openvim.py, classe base para interfacear com OpenVIM (classe derivada de vimconn_openvim).

’ ’ ’

Schema j s o n f o r m a t s f o r d a t a e x c h a n g e w i t h OpenVIM ’ ’ ’

bind_schema = {

" t i t l e " : " openvim ␣ bind_net ␣ r e s p o n s e ␣ i n f o r m a t i o n ␣ schema " , " $schema " : " h t t p : / / j s o n −schema . o r g / d r a f t −04/ schema#" , " t y p e " : " o b j e c t " , " p r o p e r t i e s " : { " u u i d " : id_schema , } , " r e q u i r e d " : [ " u u i d " ] }

get _bin d_ne ts_r espo nse_ sche ma = {

" t i t l e " : " openvim ␣ bind_net ␣ r e s p o n s e ␣ i n f o r m a t i o n ␣ schema " , " $schema " : " h t t p : / / j s o n −schema . o r g / d r a f t −04/ schema#" , " t y p e " : " o b j e c t " , " p r o p e r t i e s " : { " b i n d _ i d " : { " t y p e " : " a r r a y " , " i t e m s " : bind_schema , } } , " r e q u i r e d " : [ " b i n d _ i d " ] ,

72 Capítulo 7. Apendice

" a d d i t i o n a l P r o p e r t i e s " : F a l s e }

net_id_schema = {

" t i t l e " : " openvim ␣ n e t ␣ r e s p o n s e ␣ i n f o r m a t i o n ␣ schema " , " $schema " : " h t t p : / / j s o n −schema . o r g / d r a f t −04/ schema#" , " t y p e " : " o b j e c t " , " p r o p e r t i e s " : { " n e t _ i d " : id_schema , } , " r e q u i r e d " : [ " n e t _ i d " ] } g e t _ n e t w o r k _ c o n n e c t i o n _ r e s p o n s e _ s c h e m a ={ " t i t l e " : " openvim ␣ n e t _ c o n n e c t i o n ␣ r e s p o n s e ␣ i n f o r m a t i o n ␣ schema " , " $schema " : " h t t p : / / j s o n −schema . o r g / d r a f t −04/ schema#" ,

" t y p e " : " o b j e c t " , " p r o p e r t i e s " : { " net_conn " : { " t y p e " : " a r r a y " , " i t e m s " : net_id_schema , } } , " r e q u i r e d " : [ " net_conn " ] , " a d d i t i o n a l P r o p e r t i e s " : F a l s e } ’ ’ ’

Methods t o i n t e r f a c e w i t h OpenVIM t o r e q u e s t d a t a and c h a n g e n e t w o r k b i n d ’ ’ ’

def changeNetworkBind ( s e l f , network_id , bind_net_id=None ) :

’ ’ ’ Conne cts n e t w o r k _ i d t o b i n d _ n e t _ i d ’ ’ ’ ’ ’ ’ R e t u r n s s t a t u s c o d e o f t h e VIM r e s p o n s e ’ ’ ’

s e l f . l o g g e r . debug ( " VIMConnector : ␣ B i n d i n g ␣ n e t w o r k s ␣ network_id=%s ␣ t o ␣%s " , network_id , bind_net_id ) u r l= s e l f . u r l try : i f bind_net_id == None : v i m _ r e s p o n s e = r e q u e s t s . d e l e t e ( u r l + ’ / n e t w o r k s / ’+network_id+ ’ / d e l e t e ’ , \ h e a d e r s = s e l f . h e a d e r s _ r e q ) e l s e :

v i m _ r e s p o n s e = r e q u e s t s . put ( u r l + ’ / n e t w o r k s / ’+network_id+ ’ / ’+bind_net_id , \ h e a d e r s = s e l f . h e a d e r s _ r e q ) ## r e f r e s h o p e n f l o w r u l e s v i m _ r e s p o n s e = r e q u e s t s . d e l e t e ( u r l + ’ / n e t w o r k s / c l e a r / o p e n f l o w ’ , \ h e a d e r s = s e l f . h e a d e r s _ r e q ) v i m _ r e s p o n s e = r e q u e s t s . put ( u r l + ’ / n e t w o r k s / a l l / o p e n f l o w ’ , \ h e a d e r s = s e l f . h e a d e r s _ r e q ) except r e q u e s t s . e x c e p t i o n s . R e q u e s t E x c e p t i o n a s e : s e l f . l o g g e r . warn ( " bind_network ␣ E x c e p t i o n : ␣%s " , e . a r g s ) ; return −vimconn . HTTP_Not_Found , s t r ( e . a r g s [ 0 ] )

7.1. Modificações e inserções de código no OpenMANO 73

def getNetworkBind ( s e l f , network_id ) :

’ ’ ’ Get b i n d _ n e t w o r k _ i d t o n e t w o r k _ i d ’ ’ ’ ’ ’ ’ R e t u r n s s t a t u s c o d e o f t h e VIM r e s p o n s e ’ ’ ’

s e l f . l o g g e r . debug ( " VIMConnector : ␣ Get ␣ Bind ␣ n e t w o r k s ␣ network_id=%s " , network_id ) u r l= s e l f . u r l try : v i m _ r e s p o n s e = r e q u e s t s . g e t ( u r l + ’ / n e t w o r k s / ’+network_id+ ’ / b i n d ’ , \ h e a d e r s = s e l f . h e a d e r s _ r e q ) except r e q u e s t s . e x c e p t i o n s . R e q u e s t E x c e p t i o n a s e : s e l f . l o g g e r . warn ( " bind_network ␣ E x c e p t i o n : ␣%s " , e . a r g s ) ; return −vimconn . HTTP_Not_Found , s t r ( e . a r g s [ 0 ] )

r e s , b i n d _ n e t s = s e l f . _format_in ( vim_response , get_ bind _net s_re spon se_s chem a ) i f r e s==F a l s e :

print " v i m c o n n e c t o r . getNetworkBind ␣ e r r o r ␣ p a r s i n g ␣GET␣BIND_NET␣ vim ␣ r e s p o n s e " , \ b i n d _ n e t s return vimconn . HTTP_Internal_Server_Error , b i n d _ n e t s

return 2 0 0 , b i n d _ n e t s

def g e t N e t w o r k C o n n e c t i o n ( s e l f , network_id ) :

’ ’ ’ Get n e t w o r k _ i d t o b r i d g e n e t w o r k t o e x t e r n a l t o h o s t n e t w o r k _ i d ’ ’ ’ ’ ’ ’ R e t u r n s s t a t u s c o d e o f t h e VIM r e s p o n s e ’ ’ ’

s e l f . l o g g e r . debug ( " VIMConnector : ␣ Get ␣ n e t w o r k s ␣ c o n n e c t i o n ␣ network_id=%s " , network_id ) u r l= s e l f . u r l try : v i m _ r e s p o n s e = r e q u e s t s . g e t ( u r l + ’ / n e t w o r k s / ’+network_id+ ’ / c o n n e c t i o n ’ , \ h e a d e r s = s e l f . h e a d e r s _ r e q ) except r e q u e s t s . e x c e p t i o n s . R e q u e s t E x c e p t i o n a s e : s e l f . l o g g e r . warn ( " bind_network ␣ E x c e p t i o n : ␣%s " , e . a r g s ) ; return −vimconn . HTTP_Not_Found , s t r ( e . a r g s [ 0 ] )

r e s , n e t _ i d _ c o n n e c t i o n = s e l f . _format_in ( vim_response , \ g e t _ n e t w o r k _ c o n n e c t i o n _ r e s p o n s e _ s c h e m a ) i f r e s==F a l s e : print " v i m c o n n e c t o r . g e t N e t w o r k C o n n e c t i o n ␣ e r r o r ␣ p a r s i n g "+ \ "GET␣NET␣CONNECTION␣ v i m _ r e s p o n s e " , ‘ \ n e t _ i d _ c o n n e c t i o n return vimconn . HTTP_Internal_Server_Error , n e t _ i d _ c o n n e c t i o n print " v i m c o n n e c t o r . g e t N e t w o r k C o n n e c t i o n ␣ " , v i m _ r e s p o n s e

74 Capítulo 7. Apendice

7.2

Modificações e inserções de código no OpenVIM

Código inserido em httpserver.py, usada por uma thread para interfacear com o orquestrador.

’ ’ ’

h t t p s e r v e r . py i m p l e m e n t s a s e t o f f u n c t i o n s t o d e a l w i t h HTTP REST commands on OpenVIM s i d e

’ ’ ’

@ b o t t l e . r o u t e ( u r l _ b a s e + ’ / n e t w o r k s/<network_id >/<bind_net_id> ’ , method= ’PUT ’ ) def changeNetworkBind ( network_id=None , bind_net_id=None ) :

" " "

Change b i n d o f a n e t w o r k _ i d t o b i n d _ n e t _ i d I f b i n d _ n e t _ i d=None t h e n b i n d n e s s i s d e l e t e d " " "

my = c o n f i g _ d i c [ ’ h t t p _ t h r e a d s ’ ] [ t h r e a d i n g . c u r r e n t _ t h r e a d ( ) . name ]

my . l o g g e r . debug ( " changeNetworkBind : ␣PROCESS␣TO␣REDIRECT␣FLOW␣INITIATED " ) try :

my . ovim . changeNetworkBind ( network_id , bind_net_id ) my . ovim . d e l e t e _ o p e n f l o w _ r u l e s ( None ) my . ovim . e d i t _ o p e n f l o w _ r u l e s ( None ) #my . ovim . n e t _ u p d a t e _ o f c _ t h r e a d ( n e t w o r k _ i d ) #i f b i n d _ n e t _ i d != None : # my . ovim . n e t _ u p d a t e _ o f c _ t h r e a d ( b i n d _ n e t _ i d ) except ovim . o v i m E x c e p t i o n a s e : my . l o g g e r . e r r o r ( s t r ( e ) , e x c _ i n f o=True ) b o t t l e . a b o r t ( e . http_code , s t r ( e ) ) except E x c e p t i o n a s e : my . l o g g e r . e r r o r ( s t r ( e ) , e x c _ i n f o=True ) b o t t l e . a b o r t ( HTTP_Bad_Request , s t r ( e ) ) return

@ b o t t l e . r o u t e ( u r l _ b a s e + ’ / n e t w o r k s/<network_id >/<bind_net_id> ’ , method= ’DELETE ’ ) def removeNetworkBind ( network_id=None , bind_net_id=None ) :

" " " Change b i n d o f a n e t w o r k _ i d t o b i n d _ n e t _ i d I f b i n d _ n e t _ i d=None t h e n b i n d n e s s i s d e l e t e d " " " my = c o n f i g _ d i c [ ’ h t t p _ t h r e a d s ’ ] [ t h r e a d i n g . c u r r e n t _ t h r e a d ( ) . name ] try :

my . ovim . changeNetworkBind ( network_id , None ) my . ovim . n e t _ u p d a t e _ o f c _ t h r e a d ( network_id ) i f bind_net_id != None : my . ovim . n e t _ u p d a t e _ o f c _ t h r e a d ( bind_net_id ) except ovim . o v i m E x c e p t i o n a s e : my . l o g g e r . e r r o r ( s t r ( e ) , e x c _ i n f o=True ) b o t t l e . a b o r t ( e . http_code , s t r ( e ) ) except E x c e p t i o n a s e : my . l o g g e r . e r r o r ( s t r ( e ) , e x c _ i n f o=True ) b o t t l e . a b o r t ( HTTP_Bad_Request , s t r ( e ) ) return

7.2. Modificações e inserções de código no OpenVIM 75

def http_get_network_bind ( network_id ) :

’ ’ ’

R e p l y w i t h n e t w o r k i d o f b i n d n e t w o r k f o r <network_id> ’ ’ ’

my = c o n f i g _ d i c [ ’ h t t p _ t h r e a d s ’ ] [ t h r e a d i n g . c u r r e n t _ t h r e a d ( ) . name ] try :

net_id_conn = my . ovim . get_net_id_bind ( network_id ) d e l e t e _ n u l l s ( net_id_conn ) net_id_conn = net_id_conn [ 1 ] d a t a = { ’ b i n d _ i d ’ : net_id_conn } return format_out ( d a t a ) except ovim . o v i m E x c e p t i o n a s e : my . l o g g e r . e r r o r ( s t r ( e ) , e x c _ i n f o=True ) b o t t l e . a b o r t ( e . http_code , s t r ( e ) ) except E x c e p t i o n a s e : my . l o g g e r . e r r o r ( s t r ( e ) , e x c _ i n f o=True ) b o t t l e . a b o r t ( HTTP_Bad_Request , s t r ( e ) )

@ b o t t l e . r o u t e ( u r l _ b a s e + ’ / n e t w o r k s/<network_id >/ c o n n e c t i o n ’ , method= ’GET ’ ) def h t t p _ g e t _ n e t w o r k _ c o n n e c t i o n ( network_id ) : ’ ’ ’ R e p l y w i t h n e t w o r k i d i n w h i c h n e t w o r k _ i d i s c o n n e c t e d ’ ’ ’ my = c o n f i g _ d i c [ ’ h t t p _ t h r e a d s ’ ] [ t h r e a d i n g . c u r r e n t _ t h r e a d ( ) . name ] try :

net_id_conn = my . ovim . g e t _ n e t _ i d _ c o n n e c t i o n ( network_id ) d e l e t e _ n u l l s ( net_id_conn ) d a t a = { ’ net_conn ’ : net_id_conn } return format_out ( d a t a ) except ovim . o v i m E x c e p t i o n a s e : my . l o g g e r . e r r o r ( s t r ( e ) , e x c _ i n f o=True ) b o t t l e . a b o r t ( e . http_code , s t r ( e ) ) except E x c e p t i o n a s e : my . l o g g e r . e r r o r ( s t r ( e ) , e x c _ i n f o=True ) b o t t l e . a b o r t ( HTTP_Bad_Request , s t r ( e ) )

Código inserido em ovim.py, classe principal do OpenVIM em que métodos implementam as funções de gerenciamento necessárias para o suporte à alta disponibilidade.

def changeNetworkBind ( s e l f , network_id , bind_net_id ) : i f bind_net_id == None :

s e l f . db . update_rows ( " n e t s " , UPDATE={ " bind_net " : None } , \ WHERE={ " u u i d " : network_id } ) e l s e :

s e l f . db . update_rows ( " n e t s " , UPDATE={ " bind_net " : bind_net_id } , \ WHERE={ " u u i d " : network_id } )

return

def get_net_id_bind ( s e l f , network_id , l i m i t=None ) :

r e s u l t , c o n t e n t = s e l f . db . g e t _ t a b l e (SELECT={ ’ u u i d ’ : ’ u u i d ’ } , FROM= ’ n e t s ’ , \ WHERE={ ’ bind_net ’ : network_id } ) s e l f . l o g g e r . i n f o ( " get_net_id_bind : ␣ n e t w o r k ␣%s ␣ i s ␣ b i n d ␣ t o ␣%s " ,

\ c o n t e n t , network_id ) i f r e s u l t < 0 :

76 Capítulo 7. Apendice

r a i s e o v i m E x c e p t i o n ( s t r ( c o n t e n t ) , − r e s u l t ) return r e s u l t , c o n t e n t

def g e t _ r e s o u r c e _ p o r t s ( s e l f , columns=None , port_name=None , l i m i t=None ) : r e s u l t , c o n t e n t = s e l f . db . g e t _ t a b l e (SELECT=columns , \

FROM= ’ r e s o u r c e s _ p o r t ’ , \ WHERE={ ’ source_name ’ : port_name } , LIMIT=l i m i t ) s e l f . l o g g e r . i n f o ( " g e t _ n e t _ i d _ c o n n e c t i o n : ␣ r e s o u r c e ␣ p o r t ␣−␣%s " , c o n t e n t ) i f r e s u l t < 0 : r a i s e o v i m E x c e p t i o n ( s t r ( c o n t e n t ) , − r e s u l t ) return r e s u l t , c o n t e n t def g e t _ n e t _ i d _ c o n n e c t i o n ( s e l f , n e t _ i d ) : " " " T h i s f u n c t i o n f i n d s a n e t w o r k i d f o r an a b s t r a c t n e t w o r k a t t a c h e d t o a s w i t c h p o r t i n w h i c h n e t _ i d i s p h y s i c a l l y c o n n e c t e d " " " r e s u l t , c o n t e n t = s e l f . db . g e t _ t a b l e (SELECT={ ’ name ’ , ’ t y p e ’ } , \ FROM= ’ n e t s ’ , WHERE={ ’ u u i d ’ : n e t _ i d } ) i f r e s u l t < 0 : r a i s e o v i m E x c e p t i o n ( s t r ( c o n t e n t ) , − r e s u l t ) f o r n e t in c o n t e n t : s e l f . l o g g e r . i n f o ( " g e t _ n e t _ i d _ c o n n e c t i o n : ␣ n e t ␣%s ␣ t y p e ␣%s " , \ n e t [ ’ name ’ ] , n e t [ ’ t y p e ’ ] ) i f n e t [ ’ t y p e ’ ] == ’ b r i d g e _ d a t a ’ : #g e t h o s t i n t e r f a c e name f o r p o r t o u t net_name = n e t [ ’ name ’ ]

port_name = net_name [ net_name . f i n d ( ’ macvtap : ’ ) + 8 : len ( net_name ) ] s e l f . l o g g e r . i n f o ( " g e t _ n e t _ i d _ c o n n e c t i o n : ␣ port_name ␣−␣%s " , port_name ) try : #s e a r c h f o r n e t w o r k l i n k e d t o s w i t c h p o r t r e s u l t , c o n t e n t 1 = s e l f . g e t _ r e s o u r c e _ p o r t s ( { ’ s w i t c h _ p o r t ’ : ’ s w i t c h _ p o r t ’ } , \ port_name ) i f r e s u l t < 0 : r a i s e o v i m E x c e p t i o n ( s t r ( c o n t e n t 1 ) , − r e s u l t ) s e l f . l o g g e r . i n f o ( " g e t _ n e t _ i d _ c o n n e c t i o n : ␣ s w i t c h ␣ p o r t ␣−␣%s " , c o n t e n t 1 ) r e s u l t , c o n t e n t 2 = s e l f . db . g e t _ t a b l e (SELECT={ ’ n e t _ i d ’ } , \ FROM= ’ p o r t s ’ , WHERE=c o n t e n t 1 [ 0 ] ) s e l f . l o g g e r . i n f o ( " g e t _ n e t _ i d _ c o n n e c t i o n : ␣ n e t ␣ c o n n e c t i o n ␣−␣%s " , c o n t e n t 2 ) i f r e s u l t < 0 : r a i s e o v i m E x c e p t i o n ( s t r ( c o n t e n t 2 ) , − r e s u l t ) except E x c e p t i o n a s e : s e l f . l o g g e r . e r r o r ( " g e t _ n e t _ i d _ c o n n e c t i o n : ␣%s " , e ) return None return c o n t e n t 2

77

Referências

AVIZIENIS, A. et al. Basic concepts and taxonomy of dependable and secure computing.

IEEE transactions on dependable and secure computing, IEEE, v. 1, n. 1, p. 11–33, 2004.

Citado na página 35.

ETSI. Etsi, nfvisg - network functions virtualization, white paper. (2012-10-20)[2014-02-

14]. http://www.etsi.org/technologies-clusters/technologies/nfv, 2012. Citado na página

36.

ETSI. Technologies and clusters;technologies;nfv. 2012. Disponível em: <http:

//www.etsi.org/technologies-clusters/technologies/nfv>. Citado na página 39.

ETSI. Etsi gs nfv-rel 002 - reliability; report on scalable architectures for reliability

management. 2014. Disponível em: <http://www.etsi.org/deliver/etsi_gs/NFV-REL/

001_099/002/01.01.01_60/gs_nfv-rel002v010101p.pdf>. Citado na página 66. ETSI. Gs nfv-man 001 v1.1.1 (2014-12) - network functions virtualisation (nfv); management and orchestration. p. 45, 2014. Disponível em: <http://www.etsi.org/deliver/

etsi_gs/NFV-MAN/001_099/001/01.01.01_60/gs_NFV-MAN001v010101p.pdf>.

Citado na página 39.

ETSI. Network functions virtualisation (nfv); management and orchestration. In: .

ETSI GS NFV-MAN 001 V1.1.1. 650 Route des Lucioles F-06921 Sophia Antipolis Cedex

- FRANCE: [s.n.], 2014. p. 45. Citado 4 vezes nas páginas 43,49, 51e 66.

ETSI. Gs nfv-rel 001 v1.1.1 (2015-01) - network functions virtualisation (nfv); resiliency

requirements. p. 14, 2015. Disponível em: <http://www.etsi.org/deliver/etsi_gs/

NFV-REL/001_099/001/01.01.01_60/gs_NFV-REL001v010101p.pdf>. Citado na

página 41.

ETSI. Gs nfv 002 v1.2.1 (2014-12) - network functions virtualisation (nfv); architectural

framework. p. 14, 2018. Disponível em: <http://www.etsi.org/deliver/etsi_gs/NFV/001_

099/002/01.02.01_60/gs_NFV002v010201p.pdf>. Citado 2 vezes nas páginas39 e 40. ETSI ISG NFV. "network functions virtualization industry specification group etsi site". 2012. Disponível em: <http://www.etsi.org/technologies-clusters/technologies/nfv>. Citado na página 29.

GLOSSARY, T. Document T1. 523-2007, Alliance for Telecommunications Industry

Solutions. 2007. Citado na página28.

GONZALEZ, A. et al. Service availability in the nfv virtualized evolved packet core. In: IEEE. Global Communications Conference (GLOBECOM), 2015 IEEE. [S.l.], 2015. p. 1–6. Citado 2 vezes nas páginas 37 e38.

HAUTAKORPI, J. RFC 5853:” Requirements from SIP Session Border Control

78 Referências

KIM, T.; KOO, T.; PAIK, E. Sdn and nfv benchmarking for performance and reliability. In: IEEE. Network Operations and Management Symposium (APNOMS), 2015 17th

Asia-Pacific. [S.l.], 2015. p. 600–603. Citado 2 vezes nas páginas 33 e34.

LOPEZ, D. R. Network functions virtualization: Beyond carrier-grade clouds. In: IEEE.

Optical Fiber Communications Conference and Exhibition (OFC), 2014. [S.l.], 2014. p.

1–18. Citado 2 vezes nas páginas37 e41.

MAKAYA, C. et al. Policy-based nfv management and orchestration. In: IEEE. Network

Function Virtualization and Software Defined Network (NFV-SDN), 2015 IEEE Conference on. [S.l.], 2015. p. 128–134. Citado 2 vezes nas páginas32e 34.

MIJUMBI, R. et al. Management and orchestration challenges in network functions virtualization. IEEE Communications Magazine, IEEE, v. 54, n. 1, p. 98–105, 2016. Citado na página29.

MONTELEONE, G.; PAGLIERANI, P. Session border controller virtualization towards"service-defined"networks based on nfv and sdn. In: IEEE. Future Networks and

Services (SDN4FNS), 2013 IEEE SDN for. [S.l.], 2013. p. 1–7. Citado 3 vezes nas páginas31,34 e38.

Open Source MANO. Open source mano project site. 2016. Disponível em:

<https://osm.etsi.org/>. Citado na página 29.

OPENBATON. Openbaton git site. 2016. Disponível em: <http://openbaton.github.io/

index.html#about>. Citado 2 vezes nas páginas32 e 34.

OPNFV. High availability for opnfv. 2016. Disponível em: <https://wiki.opnfv.org/

display/availability/High+Availability+For+OPNFV>. Citado na página 31.

OPNFV. Open platform for nfv (opnfv). 2016. Disponível em:<https://www.opnfv.org/>. Citado 2 vezes nas páginas 31e 34.

ORDONEZ-LUCENA, J. et al. Network slicing for 5g with sdn/nfv: Concepts, architectures, and challenges. IEEE Communications Magazine, IEEE, v. 55, n. 5, p.

80–87, 2017. Citado na página66.

OSM Projects. 2015. Disponível em: <https://osm.etsi.org/gitweb/>. Citado na página

41.

QIU, Q. et al. Design a high availability platform for the carrier grade applications. In:

2011 IEEE 3rd International Conference on Communication Software and Networks. [S.l.:

s.n.], 2011. Citado 2 vezes nas páginas28 e35.

RAJAGOPALAN, S.; WILLIAMS, D.; JAMJOOM, H. Pico replication: A high availability framework for middleboxes. In: ACM. Proceedings of the 4th annual Symposium on Cloud

Computing. [S.l.], 2013. p. 1. Citado na página 66.

RIFT.IO. Virtual network function descriptor (vnfd:vnfd) - vdu data model

(vnfd:vdu). In: . MANO Descriptor Reference Guide. Burlington, US: [s.n.], 2017.

Disponível em:<https://open.riftio.com/documentation/riftware/4.3/a/descriptor/vnfd/

vnfd-vdu-data-model.htm>. Acesso em: 20 mar. 2018. Citado 2 vezes nas páginas 43

Referências 79

ROSSEM, S. V. et al. Deploying elastic routing capability in an sdn/nfv-enabled environment. In: IEEE. Network Function Virtualization and Software Defined Network

(NFV-SDN), 2015 IEEE Conference on. [S.l.], 2015. p. 22–24. Citado 2 vezes nas páginas

33e 34.

SOENEN, T. et al. Optimising microservice-based reliable nfv management &

orchestration architectures. In: IEEE. Resilient Networks Design and Modeling (RNDM),

2017 9th International Workshop on. [S.l.], 2017. p. 1–7. Citado 2 vezes nas páginas 32

e 34.

TALEB, T.; KSENTINI, A.; SERICOLA, B. On service resilience in cloud-native 5g mobile systems. IEEE Journal on Selected Areas in Communications, IEEE, v. 34, n. 3, p.

483–496, 2016. Citado 2 vezes nas páginas 31e 34.

"TELEFóNICA NFV Reference Lab". 1988. Disponível em: <http://www.tid.es/

long-term-innovation/network-innovation/telefonica-nfv-reference-lab>. Citado na página 41.

TRIVEDE, K. S. et al. Modeling high availability. In: IEEE. 2006 12th Pacific Rim

International Symposium on Dependable Computing (PRDC’06). [S.l.], 2006. p. 154–164.

Citado na página 28.

VIDEOLAN. Videolan website. 2015. Disponível em: <https://www.videolan.org/>.

Citado na página 60.

YRJO, R.; RUSHIL, D. Cloud computing in mobile networks—case mvno. In: IEEE.

Intelligence in Next Generation Networks (ICIN), 2011 15th International Conference on.

Documentos relacionados